开发者

jQuery variable into selector not working in ie

开发者 https://www.devze.com 2022-12-09 23:55 出处:网络
Hey, I\'m desperate right here. jQuery: $(\".rotateme li a\").click(function(){ var curid = $(this).attr(\'id\');

Hey, I'm desperate right here.

jQuery:

    $(".rotateme li a").click(function(){
    var curid = $(this).attr('id');
    $('#box'+curid).fadeIn('slow');
    return false;
    });

$('.close').click(function() {$(this).parent().fadeOut("fast");});

Html (the .rotateme li a bit)

<ul class="rotateme">
<li><a href="#" id="ca1"><img src="http://bythescruff.com/redesign/wp-content/uploads/em_ca1.jpg" alt="Small Client Image" /></a></li>
</ul>

Html (the box that is supposed to fade in)

<div id="boxca1" class="clbox invis">
<div class="close pngfix"><p>close</p></div>
<div class="clbox-wrap"><div class="dispwrap"><a href="none" class="climgapp">
<img src="http://bythescruff.com/redesign/wp-content/uploads/em_ca1_l.jpg" alt="Clients image" /></a></div>
<p class="clextlnk"><a href="none" title="none">none</a></p>
<h1 class="cltitle">Computer active</h1>
<div class="c"></div>
<p class="pinfo">Even more additional details.</p>
</div></div>

Problem: http://screenr.com开发者_开发百科/rqN (quick demo, how it works in firefox and doesn't in ie and chrome)

Works fine in ff.

Everything else does NOTHING.

The annoying thing is that the variable is defined properly, I can alert it out, I can text it into anything, works fine across the board, but getting it into the fricken selector is simply not happening.

The selector is also defined properly, $(".rotateme li a") works absolutely fine (binding .click events on it works fine).

What's really frustrating, is that it works fine in firefox and doesn't in everything else.

Please help.


The problem was the nl2br parsing that I used in php. nvm.

0

精彩评论

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