, , , .
Superfish, destroy, , flexNav , , :
flexNavDestroy = function(){
$('.touch-button').off('touchstart click').remove();
$(('.item-with-ul *').off('focus');
}
:
function WidthChange(mq) {
if (mq.matches) {
if(typeof(flexNav) != "undefined") {
flexNavDestroy();
}
superfish = $("ul.sf-menu").superfish({
delay: 350,
speed: 400,
});
} else {
if(typeof(superfish) != "undefined") {
superfish.superfish('destroy');
}
flexNav = $("ul.flexnav").flexNav({
'animationSpeed': '250',
'transitionOpacity': true,
'buttonSelector': '.menu-button',
'hoverIntent': false
});
}
}
UPDATE
FlexNav, , .
, , FlexNav . , : flexnav ( .flexnav), , , javascript ( , ).
, JS- js-, () .flexnav .js-flexnav. , flexnav, , $('ul.flexnav').flexNav()
$('.js-flexnav').addClass('flexnav');
destroy , .
, , Superfish , FlexNav , , , Superfish .
, :
function flexNavDestroy(){
$('.touch-button').off('touchstart click').remove();
$('.item-with-ul *').off('focus');
$('.js-flexnav').removeClass('flexnav').find('ul').show();
}
jsFiddle, / flexNav : http://jsfiddle.net/9HndJ/
, !