Jquery and Mootools together

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Chris Humphreys
Forum Members
Forum Members
Posts: 12
Joined: Mon Jul 26, 2010 2:03 pm

Jquery and Mootools together

Post by Chris Humphreys »

I have a conflict between Jquery and Mootools. The former controlling my sliding menu and the later controlling my slideshow. I can get one or the other to work but not both depending on which comes first in the header.

I know there's a way round it using the "$" just can't figure it out and hope someone might be able to help.

This is my header code:

Code: Select all

<head>
<title>{sitename} - {title}</title>
{metadata}
<meta http-equiv="Content-Language" content="en-gb" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
{stylesheet}
	<link rel="stylesheet" type="text/css" href="uploads/CHP/slideshow/engine/css/slideshow.css" media="screen" />
	<style type="text/css">.slideshow a#vlb{display:none}</style>

         <__script__ src="uploads/js/jquery.js" type="text/javascript"></__script>
         <__script__ src="uploads/js/navigation3.js" type="text/javascript"></__script>

	<__script__ type="text/javascript" src="uploads/CHP/slideshow/engine/js/mootools.js"></__script>
	<__script__ type="text/javascript" src="uploads/CHP/slideshow/engine/js/visualslideshow.js"></__script>

</head>
This is my site as it currently stands:
http://www.chp-architecturalphotography.com/
The 'portfolios' tab should slide nicely to reveal the sub-menu.

Thanks

Chris
Chris Humphreys
Forum Members
Forum Members
Posts: 12
Joined: Mon Jul 26, 2010 2:03 pm

Re: Jquery and Mootools together

Post by Chris Humphreys »

Not to worry chaps, worked it out for myself  ;D
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Jquery and Mootools together

Post by Dr.CSS »

And your solution is?...
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Jquery and Mootools together

Post by KO »

I think there is 2 ways.

- Use jQuery compatibility noConflict mode. (mootools first and jQuery after)
- Use MooTools document.id instead of $ (jQuery first and MooTools after)

Here is how Mootools does it http://mootools.net/blog/2009/06/22/the ... safe-mode/
Here is how jQuery does it. http://docs.jquery.com/Using_jQuery_wit ... _Libraries
Post Reply

Return to “Layout and Design (CSS & HTML)”