javascript - jPanelMenu and scrolling not working together -


update - solution

i found solution... , super simple!

just add following css:

body { overflow-x: visible; }

it seems conflict arises when overflow-x set hidden on body jpanelmenu.

i running jpanelmenu , jrespond (jpanelmenu active on smaller screens jrespond, on larger screens menu fixed , not use jpanelmenu).

all working fine when try use kind of js apply css on page scroll, doesn't work while jpanelmenu active.

i want add floating menu button open jpanelmenu once user scrolls past header, needs active when jpanelmenu active.

here 1 of scroll snippets have been using:

jquery(window).scroll(function() {     var scroll = $(window).scrolltop();     if (scroll >= 200) {         $("#scroll-trigger").addclass("show");     } else {         $("#scroll-trigger").removeclass("show");     } }); 

this works on own, number of other different ways write out scroll method. when jpanelmenu on, scroll code rendered useless somehow.

here found on codrops, works on it's own conflicts jpanelmenu:

var cbpanimatedheader = (function() {      var docelem = document.documentelement,         header = document.queryselector( 'header' ),         didscroll = false,         changeheaderon = 300;      function init() {         window.addeventlistener( 'scroll', function( event ) {             if( !didscroll ) {                 didscroll = true;                 settimeout( scrollpage, 250 );             }         }, false );     }      function scrollpage() {         var sy = scrolly();         if ( sy >= changeheaderon ) {             classie.add( header, 'bodhi-header-shrink' );         }         else {             classie.remove( header, 'bodhi-header-shrink' );         }         didscroll = false;     }      function scrolly() {         return window.pageyoffset || docelem.scrolltop;     }      init();  })(); 

i couldn't find in code , have searched online similar , tried sooooo many different ways of implementing it's not funny. appreciated. in advance!

i found solution... , super simple!

just add following css:

body { overflow-x: visible; }

it seems conflict arises when overflow-x set hidden on body jpanelmenu.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -