Maximenu mobile and preventDefault
- johnoatwork
- Offline Topic Author
- New Member
- Posts: 19
- Thanks: 0
Replied by johnoatwork on topic Maximenu mobile and preventDefault
Posted 8 years 6 months ago #30560
Hi Ced,
Good thinking! The following code adds the classes back:
The resulting html in the mobile menu is this:
The only issue is it doesn't fire AddThis.
The same html in a custom html module anywhere on the page works, it just doesn't work when called from mobile menu.
Any thoughts on why this might be?
Regards
John
Good thinking! The following code adds the classes back:
Code:
setInterval(function(){
if(jQuery("#toolsmenu_ck-mobilebarmaximenuck").is(":visible"))
{
jQuery("div.maximenuck.item174.level1 a").addClass("addthis_toolbox custom_images addthis_button_more");
}
}, 3000);
The resulting html in the mobile menu is this:
Code:
<a href="#" class="addthis_toolbox custom_images addthis_button_more" title=""><span class="mobiletextck"> Share</span></a>
The only issue is it doesn't fire AddThis.
The same html in a custom html module anywhere on the page works, it just doesn't work when called from mobile menu.
Any thoughts on why this might be?
Regards
John
by johnoatwork
Please Log in or Create an account to join the conversation.
I don't know why your addthis is not loaded. I just think that you shall launch a clearInterval once done to break the timer, else it loop infinite
Joomlack Webmaster and Developer
by ced1870
Please Log in or Create an account to join the conversation.
- johnoatwork
- Offline Topic Author
- New Member
- Posts: 19
- Thanks: 0
Replied by johnoatwork on topic Maximenu mobile and preventDefault
Posted 8 years 6 months ago #30563
Well, I figured it out. It seems that since the class is added dynamically you have to re-register the event handler. You can't do this in the normal way but you can use the API like this after adding the classes back in:
Works now
Thanks for your input.
Cheers
John
Code:
addthis.button(".custom_images");
Works now
Thanks for your input.
Cheers
John
by johnoatwork
Please Log in or Create an account to join the conversation.
Time to create page: 0.680 seconds