これに対する回避策は次のとおりです。
スライダーは実際にはデフォルトでは機能しないため、開始時に何も呼び出さないでください
JavaScript
マウスがスライダー内で押されている間、スライダーの値を設定する関数を作成します。
押されている間、ui-slide-handle がその親への参照を返すようにする必要があります。
このソリューションは、すべての主要なブラウザーで機能します。
$(function(){
$('iframe').ready(function(){
var $document = $('#result iframe',$('#main').contents()).contents();
$('.slider',$document).slider({
//Prevent the slider from doing anything from the start
start:function(event,ui){return false;}
});
$(document).mouseup(function(){
$('.slider,.ui-slider-handle',$document).unbind('mousemove')
})
//While the ui-slider-handle is being held down reference it parent.
$('.ui-slider-handle',$document).mousedown(function(e){
e.preventDefault();
return $(this).parent().mousedown()})
//This will prevent the slider from moving if the mouse is taken out of the
//slider area before the mouse down has been released.
$('.slider',$document).hover(function(){
$('.slider',$document).mousedown(function(){
$(this).bind('mousemove',function(e){
//calculate the correct position of the slider set the value
$(this).slider('value',e.pageX*100/$(this).width())
});
}).mouseup(function(){
$(this).unbind('mousemove');
})},function(){
$( '.slider',$document ).unbind('mousemove');
})
})
});
ソリューションのリンク:
解決