WordPress javascript conflicts with my custom sliders and 3rd party plugins..??

I've got a WordPress site put together on my test server:  http://rosehillgardens.developersandbox.net/

The vertical slider menus you see on there had to be custom built to suit the client's needs.  The problem I'm having is that the javascript involved with those custom sliders is conflicting with 3rd party plugins that we try to install.

For example, when I install the NextGen image gallery plugin and have it enabled, all of my vertical sliders do not function correctly.  The only work-around I could think of right now was to look for the word gallery in the URI and then deregister the plugin on those pages.  Of course, this is not ideal as my client has to use the word Gallery in their permalinks and they also cannot add a gallery to a page that has vertical sliders.  Here's a sample...

http://rosehillgardens.developersandbox.net/landscaping/firepits-and-fireplaces-gallery/

So I really need to figure out how to ensure that my code will not conflict when the vertical sliders are running no matter what the page/permalink is.  

Any information on this would be greatly appreciated.  Thanks!
LVL 11
Andrew AngellCo-Owner / DeveloperAsked:
Who is Participating?
 
jrm213jrm213Connect With a Mentor Commented:
wordpress includes it's own javascript libraries. Technically for the best result both you doing the customization to wordpress and whoever writes the plugins should be implementing the wordpress javascript libraries so that these conflicts do not happen.

see here for how to use the included scripts: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

if you are using the included scripts already, then the plugin is at fault. Your best option is to ask whoever created the plugin to fix it so it uses the wordpress scripts, or edit the plugin yourself so that it uses the wordpress included scripts.

Not all javascripts play nicely, especially when you start mixing scripts like jquery and scriptaculous. In situations where you are using multiple frameworks, instead of using the shorthand $ to access the script use the actual script name like jQuery...

so for example instead of $('#id').show(); you would use jQuery('#id').show();

it is the same functionality you just have to type jQuery instead of the $

I hope this helps.
0
 
gwkgCommented:
Here is a guide to using javascript in Wordpress http://codex.wordpress.org/Using_Javascript
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.