expand/collapse using jQuery / JavaScript -


i tried use that jquery function nishutosh sharma (2nd post) collapse , expand sidebar. right won't work, can't find mistake. please me?

the function in javascript

function expandlist(){     $("#samples").attr("collappsed", "expanded"); } 

this html:

<div id="samples" class="collappsed" onclick="expandlist()">     <ul id="sample-list" class="list"></ul> </div> 

this css:

.expanded {     left: 0px; }  .collappsed {     left: -130px; } 

more css find in fiddle

collapsed not attribute. value of class attribute.

function expandlist(){     $("#samples").toggleclass("collappsed expanded"); } 

you fixed jsfiddle: http://jsfiddle.net/gaby/a7e9xrgb/2/


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -