Where to find script
Home › Forums › Pro Support › Where to find script
- This topic has 3 replies, 2 voices, and was last updated 3 years, 10 months ago by Kriti Sharma.
-
AuthorPosts
-
June 1, 2020 at 8:25 am #70628andershermansen@hotmail.comParticipant
I use landing pages on my site where I need to insert the script controlling Responsive Menu.
Where can I find the script? And I do not mean the shortcode. I need the full script like:<script>jQuery(document).ready(function($) {
var ResponsiveMenuPro = {
trigger: ‘#responsive-menu-pro-button’,
animationSpeed: 500,
breakpoint: 80000,
isOpen: false,
activeClass: ‘is-active’,
container: ‘#responsive-menu-pro-container’,
openClass: ‘responsive-menu-pro-open’,
activeArrow: ‘▲’,
inactiveArrow: ‘▼’,
wrapper: ‘#responsive-menu-pro-wrapper’,
linkElement: ‘.responsive-menu-pro-item-link’,
subMenuTransitionTime: 200,
originalHeight: ”,
openMenu: function() {
$(this.trigger).addClass(this.activeClass);
$(‘html’).addClass(this.openClass);
$(‘.responsive-menu-pro-button-icon-active’).hide();
$(‘.responsive-menu-pro-button-icon-inactive’).show();this.setWrapperTranslate();
$(“#responsive-menu-pro > li”).each(function(index) {
$(this).show();
$(this).animate({opacity: 0}, 0);$(this).animate({‘margin-left’:’-150px’},0);
$(this).delay(100 * index).animate({
‘margin-left’: “0”,
‘opacity’: 1
}, 500);
});this.isOpen = true;
},
closeMenu: function() {
$(this.trigger).removeClass(this.activeClass);
$(‘html’).removeClass(this.openClass);
$(‘.responsive-menu-pro-button-icon-inactive’).hide();
$(‘.responsive-menu-pro-button-icon-active’).show();this.clearWrapperTranslate();
$(“#responsive-menu-pro > li”).removeAttr(‘style’);
this.isOpen = false;
},
triggerMenu: function() {
this.isOpen ? this.closeMenu() : this.openMenu();
},triggerSubArrow: function(subarrow) {
var sub_menu = $(subarrow).parent().siblings(‘.responsive-menu-pro-submenu’);
var self = this;if(sub_menu.hasClass(‘responsive-menu-pro-submenu-open’)) {
sub_menu.slideUp(self.subMenuTransitionTime, ‘linear’,function() {
$(this).css(‘display’, ”);
}).removeClass(‘responsive-menu-pro-submenu-open’);
$(subarrow).html(this.inactiveArrow);
$(subarrow).removeClass(‘responsive-menu-pro-subarrow-active’);
} else {
sub_menu.slideDown(self.subMenuTransitionTime, ‘linear’).addClass(‘responsive-menu-pro-submenu-open’);
$(subarrow).html(this.activeArrow);
$(subarrow).addClass(‘responsive-menu-pro-subarrow-active’);
}},
menuHeight: function() {
return $(this.container).height();
},
menuWidth: function() {
return $(this.container).width();
},
wrapperHeight: function() {
return $(this.wrapper).height();
},
setWrapperTranslate: function() {
switch(‘right’) {
case ‘left’:
translate = ‘translateX(‘ + this.menuWidth() + ‘px)’; break;
case ‘right’:
translate = ‘translateX(-‘ + this.menuWidth() + ‘px)’; break;
case ‘top’:
translate = ‘translateY(‘ + this.wrapperHeight() + ‘px)’; break;
case ‘bottom’:
translate = ‘translateY(-‘ + this.menuHeight() + ‘px)’; break;
}},
clearWrapperTranslate: function() {
var self = this;},
init: function() {
var self = this;
$(this.trigger).on(‘click’, function(e){
e.stopPropagation();
self.triggerMenu();
});$(this.trigger).mouseup(function(){
$(self.trigger).blur();
});$(‘.responsive-menu-pro-subarrow’).on(‘click’, function(e) {
e.preventDefault();
e.stopPropagation();
self.triggerSubArrow(this);
});$(window).resize(function() {
if($(window).width() >= self.breakpoint) {
if(self.isOpen){
self.closeMenu();
}
$(‘#responsive-menu-pro, .responsive-menu-pro-submenu’).removeAttr(‘style’);
} else {if($(‘.responsive-menu-pro-open’).length > 0){
self.setWrapperTranslate();
}
}
});/* Desktop menu : hide on scroll down / show on scroll Up */
if (jQuery(‘#responsive-menu-pro-button’).css(‘display’) != ‘none’) {
$(‘#responsive-menu-pro-button,#responsive-menu-pro a.responsive-menu-pro-item-link,#responsive-menu-pro-wrapper input’).focus( function() {
$(this).addClass(‘is-active’);
$(‘html’).addClass(‘responsive-menu-pro-open’);
$(‘#responsive-menu-pro li’).css({“opacity”: “1”, “margin-left”: “0”});
});$(‘a,input,button’).focusout( function( event ) {
if ( ! $(this).parents(‘#responsive-menu-pro-container’).length ) {
$(‘html’).removeClass(‘responsive-menu-pro-open’);
$(‘#responsive-menu-pro-button’).removeClass(‘is-active’);
}
});
} else {
}$(‘#responsive-menu-pro a.responsive-menu-pro-item-link’).keydown(function(event) {
if ( [13,27,32,35,36,37,38,39,40].indexOf( event.keyCode) == -1) {
return;
}
var link = $(this);
switch(event.keyCode) {
case 13:
link.click();
break;
case 27:
var dropdown = link.parent(‘li’).parents(‘.responsive-menu-pro-submenu’);
if ( dropdown.length > 0 ) {
dropdown.hide();
dropdown.prev().focus();
}
break;
case 32:
var dropdown = link.parent(‘li’).find(‘.responsive-menu-pro-submenu’);
if ( dropdown.length > 0 ) {
dropdown.show();
dropdown.find(‘a, input, button, textarea’).filter(‘:visible’).first().focus();
}
break;
case 35:
var dropdown = link.parent(‘li’).find(‘.responsive-menu-pro-submenu’);
if ( dropdown.length > 0 ) {
dropdown.hide();
}
$(this).parents(‘#responsive-menu-pro’).find(‘a.responsive-menu-pro-item-link’).filter(‘:visible’).last().focus();
break;
case 36:
var dropdown = link.parent(‘li’).find(‘.responsive-menu-pro-submenu’);
if( dropdown.length > 0 ) {
dropdown.hide();
}$(this).parents(‘#responsive-menu-pro’).find(‘a.responsive-menu-pro-item-link’).filter(‘:visible’).first().focus();
break;
case 37:
event.preventDefault();
event.stopPropagation();if ( link.parent(‘li’).prevAll(‘li’).filter(‘:visible’).first().length == 0) {
link.parent(‘li’).nextAll(‘li’).filter(‘:visible’).last().find(‘a’).first().focus();
} else {
link.parent(‘li’).prevAll(‘li’).filter(‘:visible’).first().find(‘a’).first().focus();
}if ( link.parent(‘li’).children(‘.responsive-menu-pro-submenu’).length ) {
link.parent(‘li’).children(‘.responsive-menu-pro-submenu’).hide();
}
break;
case 38:
var dropdown = link.parent(‘li’).find(‘.responsive-menu-pro-submenu’);
if( dropdown.length > 0 ) {
event.preventDefault();
event.stopPropagation();
dropdown.find(‘a, input, button, textarea’).filter(‘:visible’).first().focus();
} else {
if ( link.parent(‘li’).prevAll(‘li’).filter(‘:visible’).first().length == 0) {
link.parent(‘li’).nextAll(‘li’).filter(‘:visible’).last().find(‘a’).first().focus();
} else {
link.parent(‘li’).prevAll(‘li’).filter(‘:visible’).first().find(‘a’).first().focus();
}
}
break;
case 39:
event.preventDefault();
event.stopPropagation();
if( link.parent(‘li’).nextAll(‘li’).filter(‘:visible’).first().length == 0) {
link.parent(‘li’).prevAll(‘li’).filter(‘:visible’).last().find(‘a’).first().focus();
} else {
link.parent(‘li’).nextAll(‘li’).filter(‘:visible’).first().find(‘a’).first().focus();
}if ( link.parent(‘li’).children(‘.responsive-menu-pro-submenu’).length ) {
link.parent(‘li’).children(‘.responsive-menu-pro-submenu’).hide();
}
break;
case 40:
var dropdown = link.parent(‘li’).find(‘.responsive-menu-pro-submenu’);
if ( dropdown.length > 0 ) {
event.preventDefault();
event.stopPropagation();
dropdown.find(‘a, input, button, textarea’).filter(‘:visible’).first().focus();
} else {
if( link.parent(‘li’).nextAll(‘li’).filter(‘:visible’).first().length == 0) {
link.parent(‘li’).prevAll(‘li’).filter(‘:visible’).last().find(‘a’).first().focus();
} else {
link.parent(‘li’).nextAll(‘li’).filter(‘:visible’).first().find(‘a’).first().focus();
}
}
break;
}
});}
};
ResponsiveMenuPro.init();
});
</script>June 1, 2020 at 8:26 am #70629andershermansen@hotmail.comParticipantWhen I update the settings using WP Admin area, it is not reflected on the frontend, so everytime I need to update the script on the landing page.
June 1, 2020 at 7:03 pm #70632Kriti SharmaKeymasterHi there,
Welcome to Responsive menu Pro Support Forum. Hope you are having a great day.
I will have to talk to the development team for this requirement. I will get back to you as soon as I hear back from them.
Regards,
KritiJune 3, 2020 at 5:54 am #70639Kriti SharmaKeymasterHi
I have talked to the development team and according to them, please to check with their landing page author. In order for a WordPress theme to work with plugins, there has to be a wp_head and wp_footer in the theme.
Our plugin will load our script via these hooks, there is no need to copy and paste script.
Thank you
Best regards,
Kriti -
AuthorPosts
- The topic ‘Where to find script’ is closed to new replies.