0
사용중인 슬라이더에 계산 된 기본 수치를 표시하는 솔루션이 필요합니다. 기본 슬라이더 값은 "800"으로 설정됩니다. 계산 된 금액은 "99"로 표시됩니다. 그러나 계산 된 양은 사용자가 슬라이더를 움직일 때까지 표시되지 않습니다. 그런 다음 아무런 문제가 없습니다. 페이지로드시 기본 계산량이 "99"("800"기준)가되도록 설정하려면 어떻게해야합니까?페이지로드시 기본 계산량이 비어 있음
감사합니다.
$(function() {
$("#slider-range-max").slider({
range: "100px",
min: 500,
max: 1500,
value: 800,
slide: function(event, ui) {
$("#amount").val(ui.value); //ui.value inside the event contains the slider value
var x=$("#amount").val(); //this way you access slider value anywhere in your code
var y=1.49;
var a= Math.round(x*y/12);
$("#product").html(a);
}
});
$("#amount").val($("#slider-range-max").slider("value"));
});
</script>
</head>
<body>
<p>
<input type="text" id="amount" style="border:0
; font-size: 40px; color:#f6931f; font-weight:bold;">
<label for="amount" style="border:0
; font-size: 10px; color:#f6931f; font-weight:bold; ">/per month</label>
</p>
<div id="slider-range-max"></div>
<br/>
style="border:0; font-size: 40px; color:#f6931f; font-weight:bold;">
$<span id="product"></span>
</p>
</body>
</html>
! 정말 고마워! – Drew