miojamo
miojamo

Reputation: 747

Joomla mootools-core and jquery problem

I'm using jquery us-slider and it has conflict with joomla 1.6 mootools-core.js when this file is being removed ui-slider works fine.

I'm not sure were is the problem jquery code:

  jQuery(document).ready(function() {
jQuery("#slider-ad_price").slider({
    range: true,
    min: 1,
    max: 100000,
    step: 50,
    values: [1, 100000],
    slide: function(event, ui) {
        jQuery("#ad_price").val(ui.values[0]);
        jQuery("#ad_priceb").val(ui.values[1]);
    }
});

});

Thanks

Upvotes: 0

Views: 661

Answers (2)

itsariadust
itsariadust

Reputation: 311

I rewritten your code:

$.noConflict();

jQuery(document).ready(function($) {
  $("#slider-ad_price").slider({
    range: true,
    min: 1,
    max: 100000,
    step: 50,
    values: [1, 100000],
    slide: function(event, ui) {
      $("#ad_price").val(ui.values[0]);
      $("#ad_priceb").val(ui.values[1]);
    }
  });
});

This makes jQuery to work even there are other JS frameworks in it.

Upvotes: 1

Nic Bell
Nic Bell

Reputation: 523

You shouldn't have a problem if you use Mootools with closures and "Dollar Safe Mode" mootools.net/blog/2009/06/22/the-dollar-safe-mode and jQuery no conflict. You could also try write your slider as a Mootools class.

Upvotes: 0

Related Questions