开发者

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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜