开发者

Selector returns different values jquery

I've got:

j=0;
an = $("#thumbSlider" + j + " a").eq(1);
ap = $("#thumbSlider" + j + " a").eq(0);

jQuery("div#thumbSlider" + j + " a").each(function(z) { 
  jQuery(this).bind("click", function(){
    ad = jQuery("#thumbSlider" + j + " a").eq(1);
    alert(ad.length);

. .

The first alert returns 1, but the second, on click, returns 0. 开发者_如何学GoWhy is that?


Would

jQuery(this).bind("click", function(){
  alert(this.length);

Not be what you're looking for?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜