0

I am using jQuery, jQuery UI, and jQuery Mobile on a page

<script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>

When I call

$("#slider-range").slider({range: true, min: 0, max: 100});

It invokes jQuery Mobile Slider (not intended)

How do I explicitly call jQuery UI Slider?
(without changing the order of the included scripts because it will break other things)

Aximili
  • 28,626
  • 56
  • 157
  • 216
  • 1
    Have you seen [this](http://stackoverflow.com/questions/10146868/jquery-ui-slider-conflicting-with-jquery-mobile-slider)? – dsgriffin Feb 28 '14 at 02:14
  • Ah that's it! But I was looking for a more general way of specifying which function to call explicitly. There is no way to do that is there? – Aximili Feb 28 '14 at 03:20

1 Answers1

0

Since both functions 'slider()' are added to the $() Object, you have to rename one function right after including the library

$.fn.uislider = $.fn.slider;

That's the way jquery plugins work, they extend the $ object. An other possibility is to edit the plugin itself, but I would not recommend this.

tronc
  • 683
  • 4
  • 12
  • 23