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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -