我使用的是Jquery Knob,它在页面加载时自动运行。我似乎找不到在这个函数中插入Waypoint调用的位置。任何建议都是非常感谢的。
<script>
$(document)(function () {
$('.dial').knob({
min: '0',
max: '100',
readOnly: true
});
$('.dial').each(function(){
$(this).animate({
value: $(this).data('number')
},{
duration: 950,
easing: 'swing',
progress: function () {
$(this).val(Math.round(this.value)).trigger('change');
} // progress:function
}); // middle
}); //dial.each.function
}); // function
</script>发布于 2014-10-07 11:37:56
下面的方法应该是可行的。
$(document)(function () {
$('.thing').waypoint(function(direction) { // Change ".thing" to the div class containing your knobs //
$('.dial').knob({
min: '0',
max: '100',
readOnly: true
});
$('.dial').each(function(){
$(this).animate({
value: $(this).data('number')
},{
duration: 950,
easing: 'swing',
progress: function () {
$(this).val(Math.round(this.value)).trigger('change');
} // progress:function
}); // middle
}); //dial.each.function
});
}); // functionhttps://stackoverflow.com/questions/21830846
复制相似问题