javascript - How to create Horizontal Scroll-able menu with dyanamic content -
here want create horizontal scroll-able menu using javascript
, not able achieve can 1 help?
<script type="text/javascript"> $(function () { var div = $('div.sc_menu'), ul = $('ul.sc_menu'), ulpadding = 15; var divwidth = div.width(); div.css({ overflow: 'hidden' }); var lastli = ul.find('li:last-child'); div.mousemove(function (e) { var ulwidth = lastli[0].offsetleft + lastli.outerwidth() + ulpadding; var left = (e.pagex - div.offset().left) * (ulwidth - divwidth) / divwidth; div.scrollleft(left); }); }); </script>
if want more details check site http://jsfiddle.net/qdjvb/
Comments
Post a Comment