English 中文(简体)
jQuery: 在点击时,添加带刺刀和停在窗顶上
原标题:jQuery: Add class to tab & stop going to top of window on click
  • 时间:2012-01-14 16:01:40
  •  标签:
  • jquery

我有两个问题,有我的表格内容。

1. 导言 我将如何强调目前使用我守则的表格:

rel=“nofollow> http://jsfiddle.net/FznTg/2/。

2. 结 论 我再说谎话,但当你点击一只菜单时,这还是上页的顶点(见此点,转播视窗,点击tab。

again: rel=“nofollow> http://jsfiddle.net/FznTg/2/。

确实会有希望的人能够提供帮助。

最佳回答

You can fix the scrolling issue by putting the .show() or new content before the .hide() of old content. This keeps the document from ever being so small that scrolling is not needed, thus resetting the scroll position.

So, put it in this order:

     //fix
     if (jQuery.browser.msie && jQuery.browser.version.substr(0,3) == "6.0") {
         jQuery( .tabcontent#  + stringref).show();
     } else {
         //display our tab fading it in
         jQuery( .tabcontent#  + stringref).fadeIn();
     }    

     //hide the tabs that doesn t match the ID
     jQuery( .tabcontent:not(# +stringref+ ) ).hide();

Working demo here: http://jsfiddle.net/jfriend00/E8Jgd/

为了确定目前表格的风格,你只应当加上目前表格的类别,然后才能使用特别安全局。 在你点击手把这条线带上,将把目前的表格打上“现时”级,并从任何其他表格中删除这一类:

jQuery(this).closest("li").addClass("current").siblings().removeClass("current");

之后,你可以把它同社会保障局做成:

.hometabs li.current a {color:red;}

并且,你可以把第一个表格的舱面添加到超文本中:

<li class="current"><a href="#tab1">All</a></li>

Demo here: http://jsfiddle.net/jother00/E8Jgd/

问题回答




相关问题
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: &...

热门标签