Drop down menu not working in Magento when using jQuery slider
I have a problem with getting dropdown menu to appear in Magento when using jQuery slider on home page. (displays normally on all other pages)
I'm very much new to all this but from what i understand its clashing with Magentos Prototype library开发者_高级运维. But so far any guides i was able to find online haven't fixed the issue.
I'm using the google hosted version when importing scripts, and i import them in the HTML body so they only load on the front page where they are needed.
I have already tried adding <script type="text/javascript">
jQuery.noConflict();
</script>
to head.phtml or in the actual script, replacing the $ with jQuery, self hosting it and adding <action method="addItem"><type>skin_js</type><name>js/jquery.js</name></action>
in the page.xml layout file...
... and everything i've done so far hasn't worked. It either didn't fix the navigation or it fixed the navigation but crashed the slider.
Any clues? Thanks in advance for the help.
Just as a heads up here is what i did to fix the problem:
var j$ = jQuery.noConflict();
added this before starting the script, right after the tag, and then just used j$ instead of $ in the code. Works now :)
In my case, the jquery.js
and slider.js
were being called AFTER getChildHtml('head')
. I moved it so they would be called before and now it is working OK. Whatever the conflict was, it is not an issue anymore. Now the dropdowns drop and the slider slides.
Try using firebug and see what error you are getting in most cases it is caused by the conflict if you have used jQuery.noConflict() it should work and make sure you wrap your jQuery.noConflict() in document.ready function of jQuery.
精彩评论