我在MVC3应用程序中使用Range Slider,
我希望在通过JavaScript更改滑块后更改窗口位置
怎么做?
我的代码
<script type="text/javascript">
$(function () {
$("#slider-range").slider({
range: true,
min: "0",
max: "@To",
values: ['@from', '@To'],
slide: function (event, ui) {
$("#amount").val("Rs. " + ui.values[0] + " - Rs. " + ui.values[1]);
}
});
$("#amount").val("Rs. " + $("#slider-range").slider("values", 0) + " - Rs. " + $("#slider-range").slider("values", 1));
});
slide: function (event, ui) {
var url = '@Url.RouteUrl("Category", new { categoryId = "_documentId_" })';
var finalUrl = url.replace('_documentId_', '@catId' + "?price=1000-1200");
window.location.href = finalUrl;
}
</script>
答案 0 :(得分:0)
<script type="text/javascript">
$(function () {
$("#slider-range").slider({
range: true,
min: "0",
max: "@To",
values: ['@from', '@To'],
slide: function (event, ui) {
$("#amount").val("Rs. " + ui.values[0] + " - Rs. " + ui.values[1]);
var url = '@Url.RouteUrl("Category", new { categoryId = "_documentId_" })';
var finalUrl = url.replace('_documentId_', '@catId' + "?price=1000-1200");
window.location.href = finalUrl;
}
});
$("#amount").val("Rs. " + $("#slider-range").slider("values", 0) + " - Rs. " + $("#slider-range").slider("values", 1));
});
slide: function (event, ui) {
}
</script>