Theme Joomla Templates

Template breaks Fancybox

I'm running the morfeoshow component as my photo gallery, but when I switched my site to the Power Kite template the images no longer open in the fancybox. Any ideas?

LumoMongo replied mootools or conflicting script

More than likely this is a mootools or conflicting script (perhaps mootools versions) error...
Have you tried setting the "use lightbox" setting in the template parameters to "no"?
Besides that the best thing is for skashi to have a look at it... I have passed this on to him...

skash replied Yes, Lumo is correct

Most likely a conflict in mootools libraries.
I have installed morfeoshow onto Joomla! 1.5 with the Power Kite template and the Fancybox shows fine whether I enable or disable the lightbox call in the template.

Just send us a support ticket with a link to your site and admin username/password to your site so that we can configure it from our side.

skash replied Fancybox uses jQuery

After further investigation I have discovered that Fancybox uses jQuery.

Now, with jQuery you code pretty much the same way as you do with mootools, hence the first conflict in components/com_morfeoshow/morfeoshow.php line 117-119:

$(document).ready(function() { 
$(".photo-link").fancybox({ "zoomSpeedIn": 500, "zoomSpeedOut": 500, "overlayShow": true }); 
});


Replace the lines above with the following:

jQuery.noConflict(); 
jQuery(document).ready(function() { 
jQuery(".photo-link") 
.fancybox({ 
"zoomSpeedIn": 500, 
"zoomSpeedOut": 500, 
"overlayShow": true 
}); 
});


But now declaring jQuery twice breaks fancybox as well so we have to just give it another variable name and it should work like a charm.

Replace the above code with this to resolve conflicts in jQuery:

jQueryM = jQuery; 
jQueryM.noConflict(); 
jQueryM(document).ready(function() { 
jQueryM(".photo-link") 
.fancybox({ 
"zoomSpeedIn": 500, 
"zoomSpeedOut": 500, 
"overlayShow": true 
}); 
});


And that should be it. Oh, by the way, by adding jQueryM.noConflict(); this fixes conflicts with the ever-so-popular mootools library so if your site needs to use both libraries this is how to get around that hurdle.

gobigfoot replied Code works, but still errors

Thank you for the quick response. Code works perfectly., unfortunately these error logs below:

Test site <a rel="nofollow" href="http://fa.3darchery.net" target="_blank" >http://fa.3darchery.net</a> 
 
Firebug Reports 
uncaught exception: Unable to load Shadowbox, MooTools library not found. <a rel="nofollow" href="http://fa.3darchery.net/templates/powerkite/js/contentheading.js" target="_blank" >http://fa.3darchery.net/templa...heading.js</a> 
Line 42 
 
contentHeading()contentheading.js (line 42) 
? in <a rel="nofollow" href="mailto:mootools.js@21()mootools.js">mootools.js@21()mootools.js</a> (line 21) 
? in <a rel="nofollow" href="mailto:mootools.js@20(undefined)mootools.js">mootools.js@20(undefined)mootools.js</a> (line 21) 
? in <a rel="nofollow" href="mailto:mootools.js@50(contentHeading())mootools.js">mootools.js@50(contentHeading())mootools.js</a> (line 50) 
? in <a rel="nofollow" href="mailto:mootools.js@50("domready"">mootools.js@50("domready"</a>, undefined, undefined)mootools.js (line 50) 
? in <a rel="nofollow" href="mailto:mootools.js@59()mootools.js">mootools.js@59()mootools.js</a> (line 59) 
? in <a rel="nofollow" href="mailto:mootools.js@21()mootools.js">mootools.js@21()mootools.js</a> (line 21) 
? in <a rel="nofollow" href="mailto:mootools.js@20(DOMContentLoaded">mootools.js@20(DOMContentLoaded</a> )mootools.js (line 21) 
[Break on this error] contentpaneopen = contentpane<em>.g...'td[class="contentheading"]'.getText();


Error appears on the Forums, Contacts Page, and Event List.

skash replied Add this line to index.php

I noticed that on these pages Joomla (or the component itself) does not call the mootools library implicitly so try adding this to line 6 to your index.php file ( straight after the tag ):

<script type="text/javascript" src="http://www.themejoomla.com/components/com_jomcomment/templates/pastel//media/system/js/mootools.js">


Let me know how it goes and if you are still struggling with library issues send me your ftp details and I will try debug it from my side

Mumbai Car Hire replied Mumbai Car Hire

Really great work,I would like to join your blog anyway.

Got something to add to the post shown above? Just fill in your details and thoughts below, your post will be added and if you are registered you will be automatically subscribed to this thread.

name
email
website
title
please type the security code
security code
 get notified of replies (members only, register here)

busy

INSIDE: Forum / Templates

members

search