tags:

views:

20

answers:

1

Hi, im trying to hide all the selected element on document ready, but only the element in the first li is hide, all other li requires to run my hover script before its hide here is the rough structure

 <#container>
    <.block_content>
       <ul>
          <li><.selected_content></>
          <li><.selected_content></>
          <li><.selected_content></>      

Using the document.ready function {$('.block_content > ul > li.selected').hide(); $('container').hover(function).....}

only the .selected in the first li is hidden, the other requires to hover above to trigger the second function to hide

all of these li is under the same class, so anyone have any idea to hide them all at the start?

A: 

Your HTML markup is unclear but you can hide all lis having selected class like this:

$('li.selected').hide();
Sarfraz
well thanks for answering, but there is some conflict with other jquery codes, the .hide function didn't work for all my li.selected items but only the first. Though i recoded the whole thing and it don't conflict anymore.
Devric