jqueryjquery-selectorstoggleslidetoggle

.next plus .toggle not working in IE8


I am using .toggle plus .next to slideUp/Down the li which is working fine every where except IE 8-7 which is quit weird, I would like to mention that this code is working when I am using it on my local PC but after uploading to server it doesn't work. I am using the following html.

<ul id="search_list">
     <li class="ques"><a href="javascript:void(0)">Lorem ipsum dolor malesuada.</a></li>
     <li class="ans"><div class="arw"></div>Lorem ipsum dolor malesuada.</li>
     <li class="ques"><a href="javascript:void(0)">Lorem ipsum dolor malesuada.</a></li>
     <li class="ans"><div class="arw"></div>Lorem ipsum dolor malesuada.</li>
</ul>

I have tried the following jquery code.

$("#search_list li.ques").live('click', function(){
    $(this).next("li.ans").slideToggle("fast");
});

and

$("#search_list li.ques").toggle(function(){
    $(this).next('li.ans').slideDown();
}, function(){
    $(this).next('li.ans').slideUp();
});

Solution

  • Okay I figured out the problem, I was using a plugin fastLiveFilter on same page, I moved its function below my show/hide toggle script and it works fine now in IE 7-8.

    Thanks for your comments guys.