-
AuthorPosts
-
May 6, 2011 at 1:51 pm #163672
Hi, im trying to implement a javascript library to create a color transition effect when hovering over menu links.
i can use either JQuery or Mootools.this is the function im using:
$content .= "t" .'jQuery.noConflict();' ."n";
$content .= "t" .'$(document).ready(function() {' ."n";
$content .= "t" .'$('.mainlevel-fade').dwFadingLinks({' ."n";
$content .= "t" .'color: '#008000',' ."n";
$content .= "t" .'duration: 700' ."n";
$content .= "t" .'});' ."n";
$content .= "t" .'});' ."n";when using a JQuery function i get these errors in IE:
Message: Object doesn’t support this property or method
URI: dev/components/com_k2/js/k2.jsMessage: Object doesn’t support this property or method
URI: /dev/media/system/js/mootools.jsMessage: Object doesn’t support this property or method
URI: /dev/media/system/js/mootools.jsis there a recommended library i should use to avoid conflicts with the Ja_portfolio template ?
is there a “no conflict” mode ?Thanks
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 9, 2011 at 11:27 pm #390465to remove conflicting issue: between mootools with jquer, and between jquery with jquery:
1) the mootools file must to load at first, then the jquery is loaded at second
2) a page only has only one jquery file loaded, if the page loaded more than 2 jquery files => the jquery conflict will happen,
3) you should put the following code at the nearest javascript file loading after the jquery file.
<blockquote>
jQuery.noConflict();</blockquote>
4) do not use $ sign for jquery block code:for example with wrong:
<blockquote>
$content .= “t” .’jQuery.noConflict();’ .”n”;
$content .= “t” .’$(document).ready(function() {‘ .”n”;
$content .= “t” .’$(‘.mainlevel-fade’).dwFadingLinks({‘ .”n”;
$content .= “t” .’color: ‘#008000′,’ .”n”;
$content .= “t” .’duration: 700′ .”n”;
$content .= “t” .’});’ .”n”;
$content .= “t” .’});’ .”n”;
</blockquote>must to replace by:
$content .= “t” .’jQuery.noConflict();’ .”n”;
$content .= “t” .’jQuery(document).ready(function($) {‘ .”n”;
$content .= “t” .’$(‘.mainlevel-fade’).dwFadingLinks({‘ .”n”;
$content .= “t” .’color: ‘#008000′,’ .”n”;
$content .= “t” .’duration: 700′ .”n”;
$content .= “t” .’});’ .”n”;
$content .= “t” .’});’ .”n”;or :
$content .= “t” .’jQuery.noConflict();’ .”n”;
$content .= “t” .’jQuery(document).ready(function() {‘ .”n”;
$content .= “t” .’jQuery(‘.mainlevel-fade’).dwFadingLinks({‘ .”n”;
$content .= “t” .’color: ‘#008000′,’ .”n”;
$content .= “t” .’duration: 700′ .”n”;
$content .= “t” .’});’ .”n”;
$content .= “t” .’});’ .”n”; -
AuthorPosts
This topic contains 2 replies, has 2 voices, and was last updated by Saguaros 13 years, 7 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum