English 中文(简体)
利用重点和模棱两可,在一个无序的名单上展示和隐藏一个DIV
原标题:Using focus and blur to show and hide a DIV in an unordered list

我正在使用。 Fred LeBlancs Roundabout plugin,我只将一个灯箱纳入“活跃的”中央形象(为什么我“再版”。 我也想在形象活跃时,展示一种隐藏的 d。 我已经用了灯塔,但在中央形象集中的时候,我的所有封顶都隐藏或显示,我当然需要积极的形象。 只需要一线帮助才能显示这种限制。

<li><a href="slide.jpg" rel="prettyPhoto" title="Slide">
 <img src="slide_thumb.jpg" alt="Slide" /></a>
 <div class="caption" style="display:none">Slide Caption</div>
</li>

我的法典:

$( ul.rbt li ).focus(function() {
  $( a ).addClass( active );
  $( .caption ).show()
});
$( ul.rbt li ).blur(function() {
  $( a ).removeClass( active );
  $( .caption ).hide()
});
最佳回答

这一工作应当:

$( ul.rbt li ).focus(function() {
    $(this).find( a ).addClass( active );
    $(this).find( .caption ).show()
});
$( ul.rbt li ).blur(function() {
    $( a ).removeClass( active );
    $( .caption ).hide()
});
问题回答

如果你想让每个用户都展示形象,即使图像不集中,也仍然显示封顶,那么你就能够利用这一信息。

    $( ul.rbt li ).focus(function() {
        $( a ).addClass( active );
           $( .caption ).hide()
           $( .caption ).show()
        });
    $( ul.rbt li ).blur(function() {
        $( a ).removeClass( active );
    });




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

热门标签