gpt4 book ai didi

javascript - 当鼠标向上或向下操作时,范围 slider 不排序?

转载 作者:行者123 更新时间:2023-12-02 23:16:33 25 4
gpt4 key购买 nike

我有一个像这样的范围 slider : Range Slider

我的问题是,当单击 slider 并向上或向下移动,然后释放单击时,价格排序不起作用。

我不知道如何解决这个问题?

JS:

$(function() {

var currencyIso = $("main").data('currency-iso-code');

$( "#slider-range-price" ).slider({
range:true,
min: sliderMinValue,
max: sliderMaxValue,
title: "dfsdf",
values: [ minSelectedValue, maxSelectedValue ],
slide: function( event, ui ) {
$( "#range-price" ).val( currencyIso + " " + ui.values[ 0 ]+".00" + " - "+ currencyIso +" " + ui.values[ 1 ] +".00" );
min = ui.values[ 0 ];
max = ui.values[ 1 ];
$("#amountMin").val(min);
$("#amountMax").val(max);

$(this).children("a.ui-slider-handle").first().html('<span class="slider-left-value">' + currencyIso + '&nbsp;'+min+'.00</span>');
$(this).children("a.ui-slider-handle").last().html('<span class="slider-right-value">' + currencyIso + '&nbsp;'+max+'.00</span>');
}
});

$( "#range-price" ).val( currencyIso + " " + $( "#slider-range-price" ).slider( "values", 0 ) +".00"+" - " + currencyIso + " " + $( "#slider-range-price" ).slider( "values", 1 )+".00" ); });

$('#slider-range-price').mouseup(function() {
var urlParams = new URLSearchParams(window.location.search);;
if(location.href.indexOf('?') != -1){
var input = $("<input>").attr("type", "hidden").attr("name", "q").val(urlParams.get('q'));
$('#advanceSearchFilter').append(input);
}
$('#advanceSearchFilter').submit(); });

最佳答案

尝试slidestop事件而不是 mouseup

$( "#slider-range-price" ).on( "slidestop", function( event, ui ) {} );

关于javascript - 当鼠标向上或向下操作时,范围 slider 不排序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57140739/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com