English 中文(简体)
jj 查询 iframe 隐藏/显示
原标题:jQuery iframe hide/show

Well im coding a site, and now stuck at the jQuery part, which aint my strongest thing. The site contains a top-menu nav-bar:

<a href="aboutus.html" target="iframe"><img class="tab1" src="#.png"></a>
<a href="menu.html" target="iframe"><img class="tab2" src="#.png"></a>
<a href="gallery.html" target="iframe"><img class="tab3" src="#.png"></a>
<a href="shop.html" target="iframe"><img class="tab5" src="#.png"></a>
<a href="links.html" target="iframe"><img class="tab6" src="#.png"></a>
<a href="contact.html" target="iframe"><img class="tab7" src="#.png"></a>
</div>

And a iframe in the middle of the page, which loads the new html on nav click. When the index page loads, the iframe should not be seen before nav click. So ive got: iframe {display:none;} in css.

So, i need help with jQuery coding to show the iframe on nav click. Also with an effect to make the iframe hide again.

万事如意。 万事如意。

问题回答

假设 lt;iframe> id contentiframe ,你可以做以下工作:

显示 :

$("#contentIframe").show();

隐藏 :

$("#contentIframe").hide();

我认为如果你试图使用 div 并使用.load () 方法, 将比使用 iframe 更好

$("a").click(function(){
$("#mydiv").load($(this).attr("href"));
});




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签