javascript - trying to create ie9 friendly version of working code -
so have multipush menu great ... has js file can add classes of things pushed when menu activated, great... problem ie9 doesn't understand jquery plugin , trying create i.e9 snippet here original code ...
$(document).ready(function(){ // html markup implementation, overlap mode $( '#menu' ).multilevelpushmenu({ containerstopush: [$( '.tile-area-title'), ( '.navbtn'), ( '.tile-area-main' ), ('#logo-title'), ('.submenu-ctn')], collapsed: true, // fun changing of menu wrapperclass: 'mlpm_w', menuinactiveclass: 'mlpm_inactive' });
this code .navbtn when clicked stuff works browsers...
$(document).ready(function () { var $navtoggle = $('.nav-toggle'); $(".navbtn").click(function (e) { e.stoppropagation(); if($navtoggle.hasclass('active')){ $('#menu').multilevelpushmenu('collapse'); $navtoggle.removeclass('active'); $(this).addclass('active'); } else{ $('#menu').multilevelpushmenu('expand'); $navtoggle.addclass('active'); $(this).removeclass('active'); } }); $(".navbtn").hover(function () { $('.nav-toggle').addclass('hover'); },function(){ $('.nav-toggle').removeclass('hover'); }); $('#menu').on('click', function(e) { e.stoppropagation(); }); $('body').on('click', function(e){ $('#menu').multilevelpushmenu('collapse'); $navtoggle.removeclass('active'); }); });
but have added in i.e9 detection , stuff script have appended above code ...
if ((old_ie > -1) || (new_ie > -1)) { ms_ie = true; } if ( ms_ie ) { $(".navbtn").click(function (e) { ({ containerstopush: [$( '.tile-area-title'), ( '.navbtn'), ( '.tile-area-main' ), ('#logo-title'), ('.submenu-ctn')], collapsed: false }); } )}
but doesn't work... want push couple of classes on screen when menu opens/closes can out ?
edit :-
when menu button clicked f12 developer options reveals folloowing ....
multilevelpushmenu.js, line 612 character 6 script5007: unable value of property 'defaultview': object null or undefined
and relates code in js file ...
// push container(s) of choice function pushcontainers( absmove ) { if( instance.settings.containerstopush == null ) return false; $.each( instance.settings.containerstopush, function() { var lmr = parseint( $( ).css( 'margin-left' ) ), lm = isint( lmr ) ? lmr : 0, rmr = parseint( $( ).css( 'margin-right' ) ), rm = isint( rmr ) ? rmr : 0; $( ).stop().animate({ marginleft: lm + ( ( instance.settings.direction == 'rtl' ) ? (-1) : 1 ) * absmove, marginright: rm + ( ( instance.settings.direction == 'rtl' ) ? 1 : (-1) ) * absmove }); }); }
... thinking function pushcontainers not right ie9 ?
Comments
Post a Comment