我有这样的东西
$maxvalue = ($data['any'] > 0 ? $site['any'] : $site['any']);
我想根据上面的查询设置滑块的最大值,这里是滑块的代码
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Slider - Range with fixed maximum</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#slider-range-max" ).slider({
range: "max",
min: 10,
max: 60,
value: 10,
slide: function( event, ui ) {
$( "#amount" ).val( ui.value );
}
});
$( "#amount" ).val( $( "#slider-range-max" ).slider( "value" ) );
});
</script>
</head>
<body>
<p>
<label for="amount">Minimum number of bedrooms:</label>
<input type="text" id="amount" style="border: 0; color: #f6931f; font-weight: bold;" />
</p>
<div id="slider-range-max"></div>
</body>
</html>
我怎样才能做到这一点?如果有任何其他滑块代码,请发布。
我得到这个工作使用
max: "<?php echo $maxvalue; ?>",
现在提交后如何获取滑块值?
编辑 - 没有回复,我自己找到了答案 只是改变这个
<input type="text" id="amount" style="border: 0; color: #f6931f; font-weight: bold;" />
进入
<input type="text" id="cpc" name="cpc" style="border: 0; color: #f6931f; font-weight: bold;" />
您可以设置 name=any 值并通过 POTS_ 在其他页面上获取此值,就像论坛提交一样。