Cycle Plugin + Lightbox 2
- Started
- Last post
- 6 Responses
- pillhead
Has anyone here had problems getting the Cycle Plug-in and Lightbox 2 working together. Every time I paste in the script for the lightbox it overrides the cycle plug-in, so only one works at a time.
Any solution I might be missing. All script are in the <head>
- 3030
Is it all based on the jQuery? If it is, the implementation is wrong.
I have fancybox and jCarouselLite running on the same page without any problems.
Do you have some code examples?
- 3030
There is a conflict:
You use jQuery and scriptaculous - both frameworks use $ sign and this is what is causing the conflict.There are two solutions:
1. put jQuery into no-conflict mode - jQuery.noConflict(); and then in your JS code where you call jQuery you use jQuery(".element").hide() instead of $(".element").hide();2. second solution is to remove all prototype/scriptaculous JS and replace it with appropriate jQuery plugins (like jQuery fancybox);
If this is your personal project, go for the second solution as you will not mix frameworks and everything will be connected to jQuery.
- 3030
That might work:
jQuery.noConflict();
jQuery(function() {
jQuery('#slideshow').cycle({
fx: 'scrollHorz',
speed: 'fast',
timeout: 0,
pager: '#nav',
pagerAnchorBuilder: function(idx, slide) {
// return sel string for existing anchor
return '#nav li:eq(' + (idx) + ') a';
}
});jQuery('#direct').click(function... {
jQuery('#nav li:eq(2) a').triggerHandler('click');
return false;
});});
Note - I replaced $ with jQuery assuming that all of the code in that block belongs to jQuery
- pillhead0
Cheers for the advise mate, I appreciate it.
- 3030
I would go for the lightbox replacement;
Check this out: http://line25.com/articles/round…
My personal choice is fancybox as you can put html and iFrames inside of that