Maison > interface Web > tutoriel HTML > le corps du texte

如何从一个页面控制另一个页面的样式_html/css_WEB-ITnose

WBOY
Libérer: 2016-06-21 09:47:50
original
2352 Les gens l'ont consulté

如图,这是通过页面框架凑在一起的页面,左右是两个不同的页面,左右分别暂命名为A、B,如何通过点击B中的某个复选框,让A中的菜单某个项高亮一下,因为不在同一个页面,所以感觉不简单的样子。

回复讨论(解决方案)

iframe页面与父页面有引用关系,主页面通过 iframe对象.contentWindow访问iframe页面window对象,iframe页面通过window.parent访问父页面window对象;非跨域情况下可以互相操作

iframe页面与父页面有引用关系,主页面通过 iframe对象.contentWindow访问iframe页面window对象,iframe页面通过window.parent访问父页面window对象;非跨域情况下可以互相操作
不是很懂,可以举个例子来说明一下吗


iframe页面与父页面有引用关系,主页面通过 iframe对象.contentWindow访问iframe页面window对象,iframe页面通过window.parent访问父页面window对象;非跨域情况下可以互相操作
不是很懂,可以举个例子来说明一下吗
var frmwnd = document.getElementById('iframeID').contentWindow;
frmwnd.document.getElementById('divid').style.backgroundColor="Red";

不好意思,这方面我不懂

不好意思,这方面我不懂
下次数据库方面在来找你吧

source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!