Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-26-2011, 02:34 PM   PM User | #1
11va17bene
New to the CF scene

 
Join Date: Dec 2010
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
11va17bene is an unknown quantity at this point
Making two jquery scripts work together on page

I have searched and found other people have this problem. I'm using a jquery scrollTo script and lightbox2 script. They are not playing nice together on the same page. I saw something about putting in no conflict, where in the world do I do that, I am not a programmer. The thing is my code for lightbox is in the <head> tag and the code for the scrollTo is in the body tag. Here is the code for the lightbox. Any help is so so awesome.

<!--Lightbox-->
<script type="text/javascript" src="lightbox2/prototype.js"></script>
<script type="text/javascript" src="lightbox2/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="lightbox2/lightbox.js"></script>
<link rel="stylesheet" href="lightbox2/lightbox.css" type="text/css" media="screen" />


<style type="text/css">
<!--
-->
</head>
11va17bene is offline   Reply With Quote
Old 11-27-2011, 11:10 AM   PM User | #2
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,584
Thanks: 5
Thanked 864 Times in 841 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
OK, first understand what you’re doing, then do it. Obviously you just copied/pasted together random scripts from the internet since your lightbox script is using the prototype framework and you said you were using jQuery scrollTo. Exactly this is the problem but by adding a noconflict function you’re not solving the problem, you’re making it even more complicated.

My advice is: search for a lightbox type plugin that is based on jQuery, not prototype. I. e. choose one JS framework and stick with it throughout your website. But having seen a similar problem a few days ago I’d also like to remind you: The current version of jQuery is 1.7.1 so don’t use a plugin that comes with/relies on jQuery 1.2.3 or something like that as it’s most likely outdated and development has ceased.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Reply

Bookmarks

Tags
jquery, lightbox

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:28 AM.


Advertisement
Log in to turn off these ads.