How can I set a default value for ion.rangeSlider

问题: Could you help me to set the default value to my input? As I submit the range that within the form it always take the min to max and it does not care about the default va...

问题:

Could you help me to set the default value to my input?

As I submit the range that within the form it always take the min to max and it does not care about the default value that I put it in the input value.

How can I solve this problem?

    <input type="text" class="js-range-slider clicked"  id="rangeme" name="Project_Cost" value="-1" /> 
        <script>
            $(".js-range-slider").ionRangeSlider({
                type: "double",
                min: 0,
                max:<?php  echo $max;?>,
                from: 0,
                values:$(this).find('.clicked').val(),
                to: <?php  echo $max;?>,
                grid: true
            });                      
        </script>

回答1:

Just check this default demo

http://ionden.com/a/plugins/ion.rangeSlider/demo.html

you need to put default variable using "from" parameter (in demo example from is 550 so on start 550 is selected), in your code from is 0 so slider is always on min which is also 0

  • 发表于 2019-02-26 22:58
  • 阅读 ( 178 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除