Jump to content

Two scripts using same js file causing conflict


shalhevet
 Share

Recommended Posts

Hello everyone,

 

On my webpage i am trying to use to scrips:

 

Circular content carousel (http://tympanus.net/codrops/2011/08/16/circular-content-carousel/)

 

and

 

jQuery image Magnify v1.11

 

The problem is that both scripts are using the "jquery.min.js" file.

 

The first script is calling to version 1.6.2 and the second script is calling for version 1.3.2

 

What is it i want?

 

I want to use the carousel to show my content and like to add a zoom option to view image on larger size.

 

The zoom function (second script) does not work as long as i have a link to the first "jquery.min.js"

 

Any help is very much appreciated

 

 

Link to comment
Share on other sites

Probably best to use only one jquery.min.js and the most recent version if possible. IF one of those two scripts requires a specific version of jquery.js for that script to work, then use that jquery.js instead and see if it works with the other script as well. Usually though in most cases both scripts should work when you call to one(same) jquery file.

Link to comment
Share on other sites

Thank you Don E, i have done as you suggested but it is not working for me.

 

Is it possible for you (or anyone else) to make a sample page wheren both scripts work?

 

I'm sorry, it is not that i'm lazy i just don't understand much of this.

 

Please, i would very much appreciate it

Link to comment
Share on other sites

It sounds like your library requires the 1.3.2 version. so what happened when you switched it to that? Look in your browsers error console for any errors. It will tell you exactly what the problem is.

 

If you need the 1.6 version, then consider finding a better version of the plugin you are using so you can use a newer version of jQuery.

 

Do you have a link to this site?

Link to comment
Share on other sites

I have uploaded a sample page of the site.

 

As you can see i have a link to "more" which open an extra window with some text lines in it.

 

What i would like to do is when click on the image (in the sample the woman) i want it to open the image in a bigger version lightbox style.

 

There is my problem, the zoom function on the image does not work :-(

 

Hope you can help me with this.

 

Many thanks in advance

 

Link to site: www.pakanri.nl

Link to comment
Share on other sites

As I suggested, you should be looking in your browsers error console for errors. There are 5 files that I see as being 404 Not Found, an important one being jquery.magnifier.min.js. You should fix the paths to your files so those errors are cleared up.

 

Looking at the source, a more practical folder name might be js, rather than Dynamic Drive DHTML Scripts- jQuery Image Magnify_files

 

And your including jQuery 1.6.2 twice. You should only include it once.

Link to comment
Share on other sites

Please forgive my ignorance, I have uploaded by mistake the wrong file.

 

I have just now uploaded the correct version with the correct links.

 

When using my browser error console i receive the following:

 

  1. [*]
Uncaught TypeError: Cannot call method 'magnify' of undefined jquery.magnifier.js:85(anonymous function)jquery.magnifier.js:85o.extend.eachjquery.min.js:12o.fn.o.eachjquery.min.js:12jQuery.fn.imageMagnifyjquery.magnifier.js:80(anonymous function)jquery.magnifier.js:124o.extend.eachjquery.min.js:12o.fn.o.eachjquery.min.js:12(anonymous function)jquery.magnifier.js:115(anonymous function)jquery.min.js:19o.extend.eachjquery.min.js:12o.extend.readyjquery.min.js:19(anonymous function)jquery.min.js:19event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

but i don't know what it means :-(

Link to comment
Share on other sites

You're still including jQuery and the magnify library twice and from the reading the docs, the last referenced version of jQuery they mention is 1.4.4.

 

So as I have mentioned before, remove duplicate script includes and downgrade jQuery to a version that you know is supported by your library.

 

The code examples on their page look pretty straightforward and are given in steps.

http://www.dynamicdrive.com/dynamicindex4/imagemagnify.htm

 

So just start small and check for errors as you go along. The key is to just not pile everything on at once. Start small and do it in steps, so you can pinpoint exactly where the error comes from if it does show up.

Link to comment
Share on other sites

Hello again,

 

I did as you say. I have removed the double script and changed it so it call on the 1.4.4. js.

 

Now the zoom function works but the other script (when you click on "More") does not.

 

The "read more" script needs the 1.6.2. js version and the zoom needs the 1.4.4. version.

 

That is my problem, how can i make this two scripts work together?

 

many thanks in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...