Scroll using buttons rather than scroll bar css,html,javascript -


i wan't make horizontal navbar scrollable. items in navbar scroll when cursor hovers on button points direction navbar scroll in. information on how can helpful. thank you.

you something this, uses javascript prevent type of scrolling unless or down arrow hovered over.

var down = document.getelementbyid('down'),     = document.getelementbyid('up'),     body = document.body;  var timeout; down.onmouseover = function (e) {     timeout = setinterval(function () {                 window.scrollby(0, 7);     }, 20) }; down.onmouseout = function (e) {     if (timeout) {         clearinterval(timeout);     } };  up.onmouseover = function (e) {     timeout = setinterval(function () {              window.scrollby(0, -7);     }, 20) }; up.onmouseout = function (e) {     if (timeout) {         clearinterval(timeout);     } };   // left: 37, up: 38, right: 39, down: 40, // spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36, backspace: 8 var keys = [37, 38, 39, 40, 32, 34, 33, 35, 36, 8];  function preventdefault(e) {   e = e || window.event;   if (e.preventdefault)       e.preventdefault();   e.returnvalue = false;   }  function keydown(e) {     (var = keys.length; i--;) {         if (e.keycode === keys[i]) {             preventdefault(e);             return;         }     } }  function wheel(e) {   preventdefault(e); } 

credit goes galambalazs answer in question aided me in disabling page scrolls


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -