JQRangeSlider中的JavaScript错误

时间:2012-08-01 01:28:27

标签: javascript jquery jquery-ui slider

似乎在使用JQRangeSlider时遇到了一些问题。尝试将此工具实现到MVC项目中。调用滑块后,永远不会达到警报。有bug吗?我在Dreamweaver中的另一个项目中工作,虽然它在实时预览模式下呈现得很好但它无法将它带到任何浏览器。这是我的代码......

    ViewBag.Title = "Test";
    Layout = "";
    }

<html>
<head>
<title>"Slider"</title>
    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/start/jquery-           ui.css" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/slider/CSS/classic.css")" rel="stylesheet"   type="text/css" />



    <script src="@Url.Content("http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js")" type="text/javascript"></script>
    <script src="../../Content/slider/Scripts/jquery-ui-1.8.22.custom.min.js" type="text/javascript"></script>

    <script src="@Url.Content("~/Content/slider/Scripts/jQRangeSliderMouseTouch.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/slider/Scripts/jQRangeSliderDraggable.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/slider/Scripts/jQRangeSliderBar.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/slider/Scripts/jQDateRangeSliderHandle.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/slider/Scripts/jQRangeSliderLabel.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/slider/Scripts/jQEditRangeSliderLabel.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/slider/Scripts/jQRangeSlider.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/slider/Scripts/jQEditRangeSlider.js")" type="text/javascript"></script>
</head>


<body>

<div class="page-header">
    <h2>Test</h2>

</div>
<div id="slider" style="width:200px;"></div>
<input type="text" class="datepicker" />

<script type="text/javascript">
    $(function () {

        $("#slider").editRangeSlider();
        alert("whocareswhateverbye");

    });

</script>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

我认为您的代码在

失败了
 $("#slider").editRangeSlider();

由于jQuery 1.7的兼容性问题,因此它永远不会达到警报。

这与jQuery 1.8一样正常,如下所示:

http://jsfiddle.net/QwAqy/1/