Solved

Need to update jQuery plugin so it works with latest version of jQuery

Posted on 2013-12-29
15
643 Views
Last Modified: 2013-12-30
Hello all!
Hope you had a wonderful holiday!

So..I've got an awesome parallax plugin I'm using on a site. Worked great in HTML because version 1.6.4 of jQuery library is being used. But now I'm trying to incorporate this parallax into my custom Wordpress theme and Wordpress is using version 1.10. The Parallax is dead in the water.

I'm getting this error in the console:

event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

I'm not much of a javascript coder so I don't know where to change this.

Here's the HTML site where you can see the working parallax:

http://sandbox.intrepidrealist.com/robert-lee-fitness/

Here's my Wordpress site, where it's not working at all:

http://sandbox.intrepidrealist.com/rlf-demo/

Thanks so much!
0
Comment
Question by:Alicia St Rose
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
  • 2
15 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39745322
Both links look identical to me with no errors.
0
 
LVL 8

Author Comment

by:Alicia St Rose
ID: 39745327
Really?
I just checked again and First link works fine: When I click the navigation on the top right, I get a smooth parallax scroll. When I click anything on the Wordpress site, I get nothin'.

That isn't happening for you? I'm on Chrome.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39745332
Yes I see it in Chrome (FF & IE is fine)

Just replace event.returnValue in the plugin with event.preventDefault() like it says - it's worth a try.

edit
Update to 1.11
http://bugs.jquery.com/ticket/14320
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Author Comment

by:Alicia St Rose
ID: 39745351
I've used FIND in all of the js files to locate "event.returnValue" and I'm coming up with nothing...
0
 
LVL 58

Expert Comment

by:Gary
ID: 39745355
Just update jQuery to 1.11 (I edited my answer above)
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39745395
You may need to use the migrate plug in https://github.com/jquery/jquery-migrate
0
 
LVL 8

Author Comment

by:Alicia St Rose
ID: 39745570
okay. I've update to jQuery 1.11 beta and added the migrate plugin.
I'm still not getting this to work. Not sure if I've added the migrate plugin correctly.
I did this on the HTML site and not the Wordpress site, just to test without having to worry about adding it through functions. And Wordpress has jQuery 1.10.1 so not sure if this is going to work out for me even if we debug for 1.11.

http://sandbox.intrepidrealist.com/robert-lee-fitness
0
 
LVL 53

Expert Comment

by:Scott Fell, EE MVE
ID: 39745599
Mac osx chrome browser seems to work.  The only error I get in the console is

Failed to load resource: the server responded with a status of 404 (Not Found) http://sandbox.intrepidrealist.com/robert-lee-fitness/images/dot.png
Failed to load resource: the server responded with a status of 404 (Not Found) http://sandbox.intrepidrealist.com/robert-lee-fitness/images/dot.png
0
 
LVL 58

Expert Comment

by:Gary
ID: 39746270
For wordpress you can follow here to change to 1.11, if it doesn't work then you can always revert

http://www.wpbeginner.com/wp-themes/replace-default-wordpress-jquery-script-with-google-library/
In functions.php add
//Making jQuery Google API
function modify_jquery() {
	if (!is_admin()) {
		// comment out the next two lines to load the local copy of jQuery
		wp_deregister_script('jquery');
		wp_register_script('jquery', //code.jquery.com/jquery-1.11.0-beta1.min.js', false, '1.11.0');
		wp_enqueue_script('jquery');
	}
}
add_action('init', 'modify_jquery');

Open in new window

I've amended slightly to not rely on non ssl protocol

Not sure if you are saying the new link is supposed to be using 1.11 - it is using 1.6.4...???
0
 
LVL 8

Author Comment

by:Alicia St Rose
ID: 39746600
Hi GaryC123,
Changing the jQuery like that in Wordpress breaks some of my plugins. So I need to make this work with 1.10.2.
I may be out of luck...
0
 
LVL 58

Expert Comment

by:Gary
ID: 39746637
Yeah it is beta at the mo - try taking it down to 1.9
If no luck then you may have to look at another newer plugin - a lot has changed in jQuery since 1.6
Can you zip up the files (js,css,images etc) and I will see if I have time to look through the code.
0
 
LVL 8

Author Comment

by:Alicia St Rose
ID: 39746765
Aarghh!!
It's almost impossible to keep up with the march of technology!

I hope this can be fixed, because it's the closest and easiest to implement. I looked at a few others and my eyes crossed.

You can also find the plugin here:

http://ianlunn.co.uk/articles/recreate-nikebetterworld-parallax/

Not sure if you are on Github but if you are and you manage to tweak it to work, us green newbies would be profoundly grateful if you forked it!
Parallax-debug.zip
0
 
LVL 8

Author Comment

by:Alicia St Rose
ID: 39746789
I was playing around with some other parallax plugins and realized that the style sheet I zipped might be a mess.

Here's the good one.
style.css
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39746826
Well this was easier than expected - upgrade the scrollTo to 1.4.3.1
0
 
LVL 8

Author Closing Comment

by:Alicia St Rose
ID: 39747126
Whoo HOOO!! You are a ROCK STAR!

Totally worked.
Thanks you SO much!
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question