SOLVED Cufon no compatible with another module

More
13 years 3 months ago #1 by laurelle
Hi,

Great! Glad you found the fix and have it working now.

Cheers.

Laurelle
Developer
Keashly.ca Consulting

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

More
13 years 3 months ago #2 by Rocka
Hi,

Thanks for the effore laurelle, I managed to find a solution for it on the slideshow website.

The last post on this page: jansangill.dk/phpBB3/viewtopic.php?f=9&t=280 solved it for me.

There was some more javascript in an external file that I didn't realise also needed to be jQuery.noConflict'ed

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

More
13 years 3 months ago #3 by laurelle
Hi,

Can you pass me a link to which slideshow module you are using please?

I found this, which might help you(hubpages.com/hub/How-to-use-jQuery_noConflict):
When you call .noConflict() jQuery will return $() to it’s previous owner and you will need to use jQuery() instead of shorthand $() function.

You can also use the following code snippets to still use $() in your code, but with one drawback, you will not have access to your other library’s $() method.

// Method 1
jQuery(document).ready(function($){
$("div").hide();
});

// Method 2
(function($) {
/* some code that uses $ */
})(jQuery);


TIP: Don’t forget that you can always assign jQuery to any other variable name to use it as your shorthand: var $_ = jQuery;

Another similar link: docs.jquery.com/Using_jQuery_with_Other_Libraries

If you do this:
var $j = jQuery.noConflict(); then you need to change all of your $ to $j I believe.

Good luck.

Laurelle
Developer
Keashly.ca Consulting

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

More
13 years 3 months ago #4 by Rocka
Thanks laurelle, I spent ages playing around with the code but no luck. I tried your code, both with and without the jQuery(document).ready part. But no matter what I do as soon as I add jQuery.noConflict() jslide breaks.

I got as far as the slider working with (although cufon is still not working):

var $j = jQuery;


$j(function($) {

// add a 'js' class to the body
$('body').addClass('js');

// initialise the slideshow when the DOM is ready
$slideshow.init('<?php echo $fx ?>', <?php echo $timeout ?>, <?php echo $slideSpeed ?>, <?php echo $tabSpeed ?>, '<?php echo $bg_yes ?>' );

});


but as soon as I change it to

var $j = jQuery.noConflict();


it breaks again.

I dont really know jQuery so I'm probably just missing some small detail.

Here's the page thats causing the problems: freelanceriaan.co.cc/my-work

The "Client Login" in the login box should be converted to a cufon font like on the other pages.

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

More
13 years 3 months ago #5 by laurelle
Hello,

I have had cufon working on a site that used JQuery as well as mootools. What I had to do is make sure that JQuery was in no conflict mode.

Try adding this:

jQuery.noConflict();
jQuery(document).ready(function($){
// add a 'js' class to the body
$('body').addClass('js');

// initialise the slideshow when the DOM is ready
$slideshow.init('turnDown', 8000, 1500, 1500, 'false' );
});

When you add the noconflict call you have to call the function differently as it uses the $ differently. I am not sure whether you need the jQuery(document).ready infront of the (function($) {. Sorry, not an AJAX expert.

Good luck,
Laurelle

Laurelle
Developer
Keashly.ca Consulting

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

More
13 years 3 months ago - 13 years 1 month ago #6 by Rocka
Hi,

I have installed cufon and its working on all my pages, but as soon as I enable the jslideshow module I'm using on that page, cufon stops working.

the jslideshow uses jquery (i think) and adds the following javascript to the page:
 
$(function() {
    // add a 'js' class to the body
    $('body').addClass('js');
    
    // initialise the slideshow when the DOM is ready
    $slideshow.init('turnDown', 8000, 1500, 1500, 'false' );
});  


Can someone please help out?
Last edit: 13 years 1 month ago by laurelle.

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

Joomla! & WordPress Hosts

Liquid Web is our recommended web hosting provider for Joomla! & WordPress websites. This is the host that we use for websites that we build. Liquid Web has an excellent reputation, fast servers and most importantly awesome service! They have technicians that are familiar with Joomla! & WordPress. Their technicians go above and beyond what other hosting providers do, in our opinion.

  

Liquid Web Managed Word Press  

Support Development

Please consider a small donation to support development of the extensions on this site.



Joomla! Login

This is the normal Joomla! login module not the VirtueMart login module. Click the 'Create an account' button to see how you are redirected to the VirtueMart registration form when the KC VM Registration Redirect plugin is enabled.

Joomla! & WordPress Web Design and Development

If you are interested in having a website designed or redesign or need custom Joomla! or WordPress development, please visit Keashly.ca Consulting to view our Portfolio of Joomla! & WordPress website work.

Trademarks and logos remain the property of their respective organizations.
The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries.
Keashly.ca Consulting is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Site Map Back to Top