I have 2 jquery scripts, only one at a time works =(
I am using the slider gallery (from here) and a lightbox called Pretty Photo (from here).
My webpage that I am working on is here. You will notice that the slider gallery works, but the lightbox does not.
I then made another very similar page (right here) and took out the slider gallery to get the lightbox to work.
So as you can see, I can get them each to work, but not on the same page at the same time. I'm sure it's something little and silly preventing them from cooperating but I don't know Javascript so this is above my head. I don't know anyone skilled/willing enough to help me. Some people said to check my global... something-or-others or my functions or my variables... but I don't even know what that means. Like I said, this is over my head. I'm just a photographer who taught herself HTML and CSS. I am not a programmer. Please help. If you could just tell me "Change this to that" or something, that would be so fantastic.
Note you're pulling in two different jquery scripts there. The first is v1.4.1, and of course the second is v1.2.6. Leave out the second, and change the script order to 1) jquery 2) jqueryui 3) prettyPhoto. While you're at it, I'd update your version of jQuery UI as well for good measure. See if that changes anything, post back your results.
EDIT: I just noticed down at the bottom of your document you also have this:
A guy on justanswer.com had this to say about my predicament, maybe it will help?:
"Slider Gallery insists on 1.2.6. If I load 1.3.0, the slider stops working, but prettyPhoto works like a champ. If I load 1.2.6, Slider Gallery works, but prettyPhoto just sits there and spins when you click on a thumbnail.
I need to do some research to see if it's possible to load two different versions of jQuery simultaneously. It's unlikely, but I've seen weirder things before. When I have an answer one way or the other, I'll let you know."
Ok so on that note...
Would this information tell you guys how to solve my problem?
Ok, I see what you're saying. It is technically possible to run two different versions at the same time, but I would recommend sorting out the issue and choosing two plugins that can interact with the most current version.
At any rate, that link you've posted basically explains it; you'll want to call jQuery.noConflict(), having reassigned the jQuery variable to something else prior to use, e.g.
Note in the jquery-ui script, the jQuery object must be referred to as '$j_126' (or whatever you decide to name it). This will entail changing the last line of the UI script, e.g.
Code:
})($j_126);
The newly reference $j_126 version will be passed into the anonymous function and used inside as '$' like normal. You won't have to alter any other parts of the script.
okay so I have jquery-ui-1.7.2.custom.min.js
It seems to have a lot of scripts in it.
Does that mean I need to change the last line of all of those from
Did you ever figure out your problem? im having the same issue. anyone have any advice? im trying to use two jquery scripts in one document. both work fine separately, but when both are used only one works.. below is the code.
brendanpitt, please don't hijack old threads and cross-post at the same time. This is against the forum rules and/or posting guidelines and is just wasting the time of people that wanna help.