jquery - Slide in menu creating horizontal scroll bar -
i've got issue slide-in menu. can view example here: http://jsfiddle.net/flobar/z62t2/
the problem when menu hidden, creates horizontal scroll bar. how prevent that?
html:
<div id="slidein"> <ul> <li>home</li> <li>about</li> <li>contact</li> </ul> </div>
css:
#slidein { background:red; width: 200px; float: right; margin-right: -180px; }
js:
var menu = 0; $('#slidein').click(function() { if (menu == 0) { menu = 1; $(this).animate( {marginright: '0px'},200 ); } else { menu = 0; $(this).animate( {marginright: '-180px'},200 ); } });
the way have it, need include overflow:hidden;
on wrapper.
see fiddle: http://jsfiddle.net/z62t2/5/
body { overflow-x:hidden; width:100%; }
Comments
Post a Comment