2012-12-02 24 views
0

我有一個可以改變div比例的Jquery Mobile滑塊的JSfiddle。滑塊事件無法在jqm 1.8.2上工作

我想使用它與新版本的Jquery Mobile(1.8.2),但它不工作。誰能幫忙?

<div data-role="fieldcontain"> 
<input type="range" name="slider" id="slider" value="60" min="0" max="100" /></div> 
<div id="proportion" style="border:1px solid #ccc; width:150px; height:150px;" /></div>​ 
<script>$("#slider").change(function() { sliderValue = $(this).val(); $("#proportion").width(sliderValue*3); $("#proportion").height(300-sliderValue*3); });​ </script> 

http://jsfiddle.net/gsjBC/

回答

0

您正在使用的jQuery Mobile的版本是舊版本(1.0b2),而當前的穩定版本是1.2。 jquery 1.8.2可能與jquery mobile 1.0b2不兼容。所以你可能不得不升級到最新版本的jquery mobile.Here是你用jq​​uery mobile 1.2代替1.0b2的小提琴。

http://jsfiddle.net/gsjBC/1/

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> 
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> 
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> 
+0

那小提琴是因爲使用舊版本的JQM,這是真的,但我的手機應用程序使用JQM 1.2和仍然無法正常工作。有任何想法嗎? - 這裏是我的html http://www.spiesandflyders.co.uk/test.html的鏈接 – Dan