English 中文(简体)
j QueryLinked Selectedors Not show? 这一ni子有什么错误?
原标题:jQuery Linked Selectors Not Showing? - What s wrong with this snippet?

为什么在<条码>div id = debug中显示“YES”的这种幻灯。 之后

  1. each item in id=box is clicked and placed in id=que. (assigned class click2Remove)
  2. then clicked again in que?

?


<script>
var idcurrent = 0;
$(document).ready(function() {
    $(".click2Select").click(function() {
        idcurrent = this.id;

        $("#" + idcurrent).attr("class", "removed");
        var s =  <a href="" onclick="return false" id="  + idcurrent +  " class="click2Remove">  + $("#" + idcurrent).html() +  </a> ;
        $("#que").append(s);
        $("#debug").html("selected and in que: "+idcurrent);
    });
});
$("#que").delegate("click2Remove", "click", function() {
    $("#debug").html("YES");

});​
</script>

<div id="box">
    <li><a class="click2Select" onclick="return false" href="#" id="1">1</a></li>
    <li><a class="click2Select" onclick="return false" href="#" id="2">2</a></li>
    <li><a class="click2Select" onclick="return false" href="#" id="3">3</a></li>    
</div>

<div id="que">
</div>

<div id="debug">
</div>​


http://jsfiddle.net/HWD9J/

最佳回答

页: 1 选择人需要一个拖网,班级选择人需要一个<条码>。

$("#que").delegate(".click2Remove", "click", function() {

此处为<编码>的版本。

问题回答

Ack, forgot the . in the delegation... mea culpa!





相关问题
Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Asp.Net MVC - Problem returning a model to the view

I ve recently started using the Areas functionality of the Preview2 and it was working ok until I needed to return a Model to the view. Controller: public ActionResult ForgotPassword() { return ...

Unable to generate PDB files in Visual Studio 2005

For most assemblies, I m able to generate their respective .pdb files. However, I ve got one project that isn t generating their .pdb files. I ve made sure that it on debug mode and that the project ...

热门标签