Skip to main content

Mootools and jQuery on same page

13 years 8 months ago #92572 by tyronewu
Hello there,

I found a problem when I enabled Hikashop cart modules, then the Mootools will conflict with my jQuery pages. And throgh my web site guru it recommend me to ask help from you to find the following code and have some modification.
Code:
$(document).ready(function(){ $(window).scroll(function(){ if ($(this).scrollTop() > 100) { $('.scrollup').fadeIn(); } else { $('.scrollup').fadeOut(); } }); $('.scrollup').click(function(){ $("html, body").animate({ scrollTop: 0 }, 600); return false; }); });

Where can I find the above code?

And he recommend me to start with:
Code:
jQuery(document).ready(function($){

Thanks a lot.

Please Log in or Create an account to join the conversation.

13 years 8 months ago #92618 by nicolas
Hi,

That code is not in HikaShop.

That jquery code should indeed start like you say in order to avoid conflicts with mootools code.

That code seems to be coming from your template.

Please Log in or Create an account to join the conversation.

13 years 8 months ago #92628 by tyronewu
Thanks for your reply.

But the problem only caused when cart module enabled and "product listing" in "content menus" enabled. If both of them disabled the page will go correctly.

So it's not from my template, but seem to caused by the two the packages that generate something to conflict.

Would you please take a look at them both?

Thanks a lot.

Please Log in or Create an account to join the conversation.

13 years 8 months ago #92632 by tyronewu
BTW, my site is Joomla 3.0 and my tempalte use JQuery as default.

Please Log in or Create an account to join the conversation.

13 years 8 months ago #92636 by nicolas
It sure is a conflict since HikaShop uses mootools. So on pages where you don't have HikaShop, you don't have the problem since mootools is not loaded. That doesn't mean that it comes from HikaShop.

I can look but I know all the code of HikaShop so I can guarantee you that this code is not in HikaShop.

Please Log in or Create an account to join the conversation.

13 years 8 months ago #92693 by tyronewu
Hello,

Thanks for your investigation. I found if I enabled "product listing" in "content menus" or cart module, the other pages in my site will also work improperly, not only where I place hikashop module. So maybe the conflict will be more furthure.

Hope you can check.

Please Log in or Create an account to join the conversation.

13 years 8 months ago #92697 by nicolas
And can you give the link to the page where you have the problem ?

Please Log in or Create an account to join the conversation.

13 years 8 months ago #92731 by tyronewu
I tried again, it seems only affect my pages with "JQuery" and "Mootools" enables the same time. But to be frustrated, my content contains JQuery code and if the module enabled, the page will not show properly.

Anyway to workaround this?

I have a waiting order for Hikashop because I like this product, but this issue will suffer my site a lot.

Thanks for your help.
Tyrone

Please Log in or Create an account to join the conversation.

13 years 7 months ago #92873 by Xavier
Hi,

Can you try to install the plugin "jQuery easy" ? It should solve the conflicts between jQuery and Mootools.

Please Log in or Create an account to join the conversation.

13 years 7 months ago #92947 by tyronewu
I've tried it, but still not work. I enabled "Enable JQuery" but the page still no work.

Can you check with my page to see how it conflicted and how to modify the plugin?

www.herbalnc.com/eating-habbits

This page should full of charts but now only polls.

Thanks a lot.

Please Log in or Create an account to join the conversation.

13 years 7 months ago #93102 by Jerome
Hi,

Why the file "/media/jui/js/jquery-noconflict.js" is not included in your website ?

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

13 years 7 months ago #93109 by tyronewu
I don't know that. Should I need to include that? And where to include?
Thanks.

Please Log in or Create an account to join the conversation.

13 years 7 months ago #93126 by Jerome
Hi,

Yes you need to include it.
I don't know how your template is structure, I don't know "who" make the inclusion of jQuery but the noconflict file should be include too !

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

Time to create page: 0.096 seconds
Powered by Kunena Forum