jQuery:如何在父项上隐藏框架? [英] jQuery: How to hide a frame on parent?

查看:89
本文介绍了jQuery:如何在父项上隐藏框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的主页包含框架集中的多个框架. 其中一个框架是带有按钮的工具栏,我希望能够按下该工具栏上的一个按钮,它将消失并隐藏主页上的一个框架.

I have the main page that contains multiple frames within the frameset. One of the frames is a toolbar with buttons, I would like to be able to press a button on that toolbar and it will go and hide one of the frames on the main page.

我已经在工具栏内尝试了以下方法,但是它不起作用...

I've tried the following from within the toolbar frame but it doesn't work...

$(document).parent.$("#other_frame").hide("slow");

我真的是jQuery的新手,在网上搜索后我迷路了.

I'm REALLY new to jQuery and after searching the web I'm pretty much lost.

谢谢您的帮助.

我完整的主页

<frameset frameborder="0"  rows="70, *">
   <frame name="toolbar" src="toolbar.html" marginwidth="8px" marginheight="8px" />
   <frameset id="lineNumFrameset" frameborder="0" cols="50, *">
      <frameset rows="*, 16">
      <frame id="other_frame" name="lineNum" src="lineNum.html" marginwidth="8px" marginheight="8px" align="top" />
      </frameset>

      <frame name="editor" src="editor.html" marginwidth="8px" marginheight="8px" />
   </frameset>
</frameset>

推荐答案

据我了解,您需要在div上执行隐藏操作.基本上,无论您尝试影响什么,都需要响应css display属性.如果必须使用框架,我强烈建议您使用divs,那么您将需要编写一些jQuery,实际从DOM中删除框架,而不仅仅是尝试隐藏它.

As far as my understanding of things goes, you need to perform actions like hide on divs. Basically, whatever you are trying to affect needs to respond to the css display attribute. If you must use frames, I would strongly suggest you use divs instead, then you will need to write some jQuery that actually removes the frame from the DOM instead of just trying to hide it.

这篇关于jQuery:如何在父项上隐藏框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆