Closed ghost closed 12 years ago
Hi Matt,
thanks for investigating this. I'm now using the following code, to fix this:
if(!$.mobile || !$.mobile.slider){
$.fn._uiSlider = $.fn.slider;
} else {
$.widget('jme._uiSlider', $.ui.slider.prototype);
}
If jQuery mobile is detected. JME will create a new module, so it does not depend on a specific embed order (jQuery UI -> JME -> Mobile). You can mix the files how you want :-)
Cheers Alex
Hi Alexander,
Thanks a lot for the fix. Very elegant! :)
Cheers, Matt
Hello, I know that a year ago of this commentary, but I have the same problem, I'm using a slider and I'm also using jquery-ui and jquery.mobile and slider loses its function, I tried this code but I'm not sure where I should put it, anyone can help me?
Hi Alexander,
I did some more investigation regarding jme2 compatibility with jQuery Mobile that we spoke about. The issue is that jQuery Mobile includes it's own slider plugin who's calling method's name (i.e.
$('input').slider();
) collides with jQuery UI.See jQuery Mobile Slider Documentation
To work around this, I aliased the jQuery UI slider within
jme.js
:Then I modified all the calls to the
slider
method withuislider
. Example:What do you think of this approach?
Let me know if you want me to commit my updates.
Cheers, Matt