English 中文(简体)
Jquery, div with two给人以隐蔽之门——冲突吗?
原标题:Jquery, div with two classes hide one show the other - conflict?

如果在先前的路面上得到解答,即找不到。

页: 1

每个科都有课堂,因此,我躲藏起来,并根据这一节进行表演。 问题在于第1节和第2节需要说明某些类别。

<div class="section1 section2">
blah blah
</div>

$( a.homeLink ).click(function(){
  $( .section1 ).show();
  $( .section2, .section3, .section4 ).hide();
  return false;
});

如你在该案中看到的那样,我分两节有四分之四,但是,如果一想会发生的话,则由于藏匿阶级第2节,它仍然隐藏起来。

围绕工作或解决办法?

感谢

最佳回答

详情请上section1 通常优先于<代码>第2条,只是改动了电话的次序:

$( .section2, .section3, .section4 ).hide();
$( .section1 ).show();

如果不是这样简单的话,你就不得不告诉我们什么要求。

问题回答

我建议重新思考一下你们的社保学会的表象,或重新排列 your的故事。 社会保障局和文稿活动都有一套自然的栏目,需要通过文体加以思考。 你们越是反对这一自然界、越是混淆了你的科斯塔和 Java本。

您可以增加一个通用的科级,然后过滤“内容类别”(例如,第1节):

<div class="section section1 section2">
blah blah
</div>

<div class="section section3 section4">
blah blah
</div>

$( a.homeLink ).click(function(){
  var sections = $( .section );
  $( section1 , sections).show();
  sections.not( .section1 ).hide();
  return false;
});




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

热门标签