JQuery & Mootools

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
User avatar
gmcgilli
Joomla! Explorer
Joomla! Explorer
Posts: 374
Joined: Thu Feb 22, 2007 7:07 pm
Location: USA
Contact:

Re: JQuery & Mootools

Post by gmcgilli » Fri Apr 02, 2010 2:27 am

Zyloch wrote:All decent jQuery plugins I've seen have been careful to use jQuery() instead of $(), or assign $ to jQuery in local scope. In doing so, it is no longer an issue that jQuery.noConflict() is called last in the <head> section. Is this not the case with Thickbox?

Also, when loading jQuery with JHTML::script('jquery.js', $path, false), I use the following code:

$doc =& JFactory::getDocument();
$script = 'if($===jQuery){jQuery.noConflict();}';
$doc->addScriptDeclaration($script);

This ensures that even if MooTools is loaded after jQuery and before the call to jQuery.noConflict(), that nothing bad happens.


This was just what I was looking for. Thanks for posting!

Cheers,
Garry
http://www.redmystic.com
Publish your Virtuemart products to Redmystic and Virtuemart for FREE!

terrywmu
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri May 07, 2010 2:40 pm

Re: JQuery & Mootools

Post by terrywmu » Fri May 07, 2010 2:46 pm

Zyloch wrote:All decent jQuery plugins I've seen have been careful to use jQuery() instead of $(), or assign $ to jQuery in local scope. In doing so, it is no longer an issue that jQuery.noConflict() is called last in the <head> section. Is this not the case with Thickbox?

Also, when loading jQuery with JHTML::script('jquery.js', $path, false), I use the following code:

$doc =& JFactory::getDocument();
$script = 'if($===jQuery){jQuery.noConflict();}';
$doc->addScriptDeclaration($script);

This ensures that even if MooTools is loaded after jQuery and before the call to jQuery.noConflict(), that nothing bad happens.
Majorly tech-challenged here... Where would I put that? In the jquery.js file?

Thanks,

Terry

Jimerz
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Sun Aug 02, 2009 2:13 pm
Location: Washburn, IL
Contact:

Re: JQuery & Mootools

Post by Jimerz » Fri May 07, 2010 7:55 pm

terrywmu wrote:
Zyloch wrote:All decent jQuery plugins I've seen have been careful to use jQuery() instead of $(), or assign $ to jQuery in local scope. In doing so, it is no longer an issue that jQuery.noConflict() is called last in the <head> section. Is this not the case with Thickbox?

Also, when loading jQuery with JHTML::script('jquery.js', $path, false), I use the following code:

$doc =& JFactory::getDocument();
$script = 'if($===jQuery){jQuery.noConflict();}';
$doc->addScriptDeclaration($script);

This ensures that even if MooTools is loaded after jQuery and before the call to jQuery.noConflict(), that nothing bad happens.
Majorly tech-challenged here... Where would I put that? In the jquery.js file?

Thanks,

Terry
Replace all the '$' with 'jQuery' (note the capital Q) in the javascript calling the jquery.js; not *in* jquery.js

terrywmu
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri May 07, 2010 2:40 pm

Re: JQuery & Mootools

Post by terrywmu » Fri May 07, 2010 8:04 pm

Awesome -- thank you so much, Jimerz!

Terry

ah010223
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Fri May 07, 2010 9:16 am
Location: Dhaka

Re: JQuery & Mootools

Post by ah010223 » Mon May 10, 2010 8:22 am

Thanks for this thread as I have been benefited. Actually I used the code of noConflict but plugin is also workable.
Alan

gyoza
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Dec 11, 2007 12:09 am

Re: JQuery & Mootools

Post by gyoza » Sun Jun 13, 2010 8:23 pm

SC Jquery.

How do I call sc jquery?? Can somebody provide an example .php? Thanks!

Kilian89
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Mar 05, 2010 12:07 pm

Re: JQuery & Mootools

Post by Kilian89 » Fri Aug 27, 2010 12:02 pm

i found a solution how to use jquery into front-end template

1. Download http://extensions.joomla.org/extensions ... ripts/7230
2. Install and activate it in admin panel
3. Now U can include js file in your index.php like:

Code: Select all

<script src="<?php echo $this->baseurl ?>/templates/ur_template/js/file.js" type="text/javascript"></script>
4.In js file just use:

Code: Select all

jQuery(function($){
 //put here all your jquery code ;)
});
It`s work fine.

for example i use it here in menu boxes, just hover on box ;)

Code: Select all

http://probud.softgraf.pl/

markstrange
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Sun Oct 21, 2007 2:09 pm
Contact:

Re: JQuery & Mootools

Post by markstrange » Tue Nov 23, 2010 8:52 pm

I used Kilians method with success.

User avatar
h2mao
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Thu Oct 09, 2008 11:58 pm

Re: JQuery & Mootools

Post by h2mao » Fri Nov 26, 2010 2:04 am

Kilian89 wrote:i found a solution how to use jquery into front-end template

1. Download http://extensions.joomla.org/extensions ... ripts/7230
2. Install and activate it in admin panel
3. Now U can include js file in your index.php like:

Code: Select all

<script src="<?php echo $this->baseurl ?>/templates/ur_template/js/file.js" type="text/javascript"></script>
4.In js file just use:

Code: Select all

jQuery(function($){
 //put here all your jquery code ;)
});
It`s work fine.

for example i use it here in menu boxes, just hover on box ;)

Code: Select all

http://probud.softgraf.pl/

Champion, it works for me.

:D :D

User avatar
Esteban Soler
Joomla! Explorer
Joomla! Explorer
Posts: 339
Joined: Tue May 29, 2007 6:31 pm
Location: Mar del Plata (Argentina)
Contact:

Re: JQuery & Mootools

Post by Esteban Soler » Sat Dec 11, 2010 4:37 am

If you are referring to my plugin jsloader, there is some info about how to use it in the download page. you need to install the plugin in joomla admin and use it at will on your code.

User avatar
sazz
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Tue Feb 19, 2008 3:54 pm
Location: Bulgaria
Contact:

Re: JQuery & Mootools

Post by sazz » Thu Dec 30, 2010 10:53 am

Code: Select all

jQuery(function($){
//put here all your jquery code ;)
});
Where to find that
all your jquery code

User avatar
Pete_Evans
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Thu Oct 21, 2010 8:15 am
Location: Portsmouth, UK
Contact:

Re: JQuery & Mootools

Post by Pete_Evans » Fri May 27, 2011 8:31 am

Yes! Thank you so much. Have just enabled the method Kilian89 describes and everything now works fine.

polpaulin
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 158
Joined: Wed Dec 22, 2010 12:00 pm

Re: JQuery & Mootools

Post by polpaulin » Mon Nov 07, 2011 1:28 pm

JQuery will be the best solution like Drupal and wordpress

jdran
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 186
Joined: Thu Aug 16, 2012 5:32 pm

Re: JQuery & Mootools

Post by jdran » Tue Feb 12, 2013 7:31 pm

FR6 wrote:You can find a great PDF (it is a free chapter of a book) explaining how to use jQuery and Mootools at same time without conflict at

http://www.packtpub.com/files/learning- ... ffects.pdf

via

http://www.designvsdevelop.com/using-mo ... in-joomla/

It works very well for me.
first url is dead, I found it googling the name of the chapter:
download link


Locked

Return to “Joomla! 1.5 Coding”