lnorton059
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Super Cache] WP Super Cache destroys my pagesHey,
I contacted Divi and they said it’s due to their Minify CSS option. If you go into Divi settings and disable this WP Super Cache should work.
Hope that helps!
Forum: Plugins
In reply to: [WooCommerce] Customise WooCommerce wc-add-to-cart (add-to-cart.js)resolved
Forum: Plugins
In reply to: [WooCommerce] Customise WooCommerce wc-add-to-cart (add-to-cart.js)I’ve just added the full path to the js file and it seems to now work.
There must be a problem with get_template_directory_uri() which thinks my template directory is something other than what it is currently set to.
Forum: Fixing WordPress
In reply to: jQuery triggers not working on mobile menuHey,
Just to explain. I was trying to create a menu structure for wordpress mobile structure which involved toggling classes to hide or reveal the sub menu. In order to Toggle the classes I needed to use jQuery. My original script would not work but I found a script online that used a delay function. For some reason jQuery fails to trigger on the mobile menu unless you use the time delay. Here is the new script that seems to work:
<script type=”text/javascript”>
(function ($) {function setup_collapsible_submenus() {
$(“.lm-mobile-menu-back”).click(function () {
$(“.visible”).removeClass(“visible”)
});var $menu = $(‘#mobile_menu’),
top_level_link = ‘#mobile_menu > .menu-item-has-children > a’;$menu.find(‘a’).each(function () {
$(this).off(‘click’);if ($(this).is(top_level_link)) {
$(this).attr(‘href’, ‘#’);
}if (!$(this).siblings(‘.sub-menu’).length) {
$(this).on(‘click’, function (event) {
$(this).parents(‘.mobile_nav’).trigger(‘click’);
});
} else {
$(this).on(‘click’, function (event) {
event.preventDefault();
$(this).parent().toggleClass(‘visible’);
});
}
});
}$(window).load(function () {
setTimeout(function () {
setup_collapsible_submenus();
}, 700);
});})(jQuery);
</script>Obviously this is now using a combination of Toggle or remove but I’m not great at Javascript. Is there a cleaner way to write this?
Thank you
Forum: Fixing WordPress
In reply to: jQuery triggers not working on mobile menuHi,
No, sorry I should of explained. This was done just to test on desktop.
The issue is you can’t apply anything to the mobile menu. Whether it be hover or click.
Thanks ??