English 中文(简体)
这能否转化为多例(20+)的工作?
原标题:Can this be converted to work with multiple (20+) instances?

I m使用该代码进行粉碎。 您点击了 im,打开了盒子,在 im子上点击也关闭了箱子。 点击的成像交换器。 到目前为止,我还没有能够把这项工作改成一个以上科。 我不了解 j或 j,但理解一些方案拟订概念。 我一直在4个小时尝试,没有uck。 我需要你们的帮助!

$(document).ready(function() {
$( #expandcontract ).toggle(
function(){ // you can add as much here as you d like
$( #box ).show( slow );
$( #imgArrows ).attr("src","images/up.png");
}, function() { // same here
$( #box ).hide( slow );
$( #imgArrows ).attr("src","images/down.png");
});
});
问题回答

在把所有伊德人换到课堂之后,你可能希望这样做:

$(document).ready(function() {
    $( .expandcontract ).toggle(
        function() {
            $( .box ,this).show( slow );
            $( .imgArrows ,this).attr("src","images/up.png");
        }, function() {
            $( .box ,this).hide( slow );
            $( .imgArrows ,this).attr("src","images/down.png");
        }
    );
});

<<>假设>,你的超文本是:

<div class="expandcontract">
    <div class="box" />
    <div class="imgArrows" />
</div>
<div class="expandcontract">
    <div class="box" />
    <div class="imgArrows" />
</div>
<div class="expandcontract">
    <div class="box" />
    <div class="imgArrows" />
</div>

只应当向一个要素提供身份证。 各位希望分配这些要素,然后用适当的类别检索所有要素,并给它们增加一个角逐手。





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

热门标签