jquery - Slide Toggle doesnt works some time -


can 1 tell me why piece of code doesn't work time.. sliding doesn't takes place every time, sometime stays still after clicking... works in 21" pc screen in mini laptop doesn't triggered.

i tried putting script document.ready function doesnt work @ all...

<div id="aboutus" onclick="showlayer('aboutus-sub');">                 <img src="more.png" id="more" title="more here.." style="width:25px;height:25px;"/></div>     <div id="aboutus-sub" style="display:none;">     <ul><li><a href="chatroom.php">chat room</a></li>     <ul><li><a href="album.php">album</a></li>     <ul><li><a href="studentsarea.php">settings</a></li>     <ul><li><a href="studentsarea.php">i student</a></li>     </ul>     </div>             </td>         </tr>     </table>     <script>         function showlayer (){         $('#aboutus-sub').css('visibility','visible').slidetoggle('slow','swing');     }     </script> 

css part

#aboutus-sub{z-index:+1; text-align:center; border-radius:4px; border:1px solid black; position:absolute; visibility:hidden; right:15px; top:61px; width:100px; color:white; height:150px; background-color:#042d18; opacity:0.88; } li a:hover{ color:#ffff24; text-decoration:underline; } ul{ padding:0px; margin:0px; } li{ list-style:none; padding:2px 0px; border-bottom:1px dashed #060dd6; margin-bottom:5px; } li a{ font-weight:bold; margin-bottom:6px; display:block; color:white; text-decoration:none; } .last{ border:0px; } 

drop .css('visibility','visible'), e.g.

$('#aboutus-sub').slidetoggle('slow','swing'); 

slidetoggle take care of visibility :)


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -