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
Post a Comment