从jquery移动滑块获取值

时间:2015-06-26 17:02:22

标签: javascript jquery html5 jquery-mobile firebase

这让我发疯了。我正在使用jquery mobile 1.4.5和firebase,我有这个代码:

<html>
    <body>
        <div>

            <label for="size">Stroke thickness:</label>
            <input type="range" name="size" id="size" value="5" min="1" max="100" data-highlight="true">

        </div>

        <script>

            //Keeps updated with the current size in firebase
            currentSize.on("value", function(snapshot)
            {
                siz = snapshot.val();
                $("#size").val(siz);
                $("#size").slider("refresh");
            });

            $("#size").on('slidestop', function(event)
            {
                var a = $("#size").val();
                currentSize.set(a);
            });

        </script>

    </body>
</html>

如您所见,我从firebase更新了滑块的值。这很好。

问题是当我尝试设置它时。它根本不起作用,我尝试了很多方法,除非我把 data-role =“none”属性,然后它就像一个魅力,但当然没有漂亮的移动主题。

我真的很感激任何帮助。

0 个答案:

没有答案
相关问题