...

View Full Version : jQuery making 2 scripts work together



JeffNL
12-13-2010, 11:56 AM
Hi,

I'm working on a project where I have two scripts; 1 accordion and 1 price range slider. These two elements work fine, apart from each other. But when I place both on one page, the accordion stops working.
Firebug comes back with $(".menu_head") is null, where menu_head is the clickable title for the accordion.

Here you can see it in action (http://www.jeffgrafix.nl/frmwrk). On the left side of the page both accordion and range slider sits. When you click for instance Enschede Centrum, this should start a submenu to slide down.

Thanks in advance for your reaction.

Jeff

SB65
12-13-2010, 01:29 PM
Looks like jQuery and mooTools are conflicting.

In frmwrk.js replace this:


/* accordion voor facetzoeken - aanbod */
$(document).ready(function() {
$(".menu_head").click(function() {
$(this).addClass('facet_open').next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("normal");
$(this).siblings().removeClass('facet_open');
});
});


with this:


$.noConflict();
/* accordion voor facetzoeken - aanbod */
jQuery(document).ready(function($) {
$(".menu_head").click(function() {
$(this).addClass('facet_open').next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("normal");
$(this).siblings().removeClass('facet_open');
});
});



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum