上拉下拉按钮的背景图片不显示

来源:3-8 微调按钮插件——spinner

yang毛线

2017-03-23 16:29

http://img.mukewang.com/58d386e200015b7b02220086.jpg

 <script type="text/javascript">

$(function() {

//定义变量

var intR = 0,

intG = 0,

intB = 0,

strColor;

// $("#input").each(function(index) {

// $(this).spinner({

$("input").spinner({

//初始化插件

max: 10,

min: 0,

//设置微调按钮递增/递减事件

spin: function(event, ui) {

if(ui.value == 8)

spnPrev.style.backgroundColor = "red";

else

spnPrev.style.backgroundColor = "green";

//setSpanColor(index, ui.value);

},

//设置微调按钮值改变事件

change: function(event, ui) {

var intTmp = $(this).spinner("value");

if(intTmp < 0) $(this).spinner("value", 0);

if(intTmp > 10) $(this).spinner("value", 10);

if(intTmp == 8)

spnPrev.style.backgroundColor = "red";

else

spnPrev.style.backgroundColor = "green";

//setSpanColor(index, $(this).spinner("value"));

}

});

});

</script>


写回答 关注

1回答

  • 梦飞翔2
    2017-03-24 16:03:22

    按钮的html代码是“<span id="spnPrev" class="prev fr"></span>”通过js进行加载

jQuery基础(五)一Ajax应用与常用插件

如何用jquery实现ajax应用,加入学习,有效提高前端开发速度

69095 学习 · 400 问题

查看课程

相似问题