jquery.ui.spinner更改 [英] jquery.ui.spinner change

查看:181
本文介绍了jquery.ui.spinner更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用最新版本的jquery.ui.spinner.js。 http://wiki.jqueryui.com/w/page/12138077/Spinner



旋转器显示和更新文本框,但是我无法弄清楚如何捕获更改事件。当您手动更改文本框中的值时,它会触发,但不会在使用旋转箭头时触发。



jquery:

  $('input [name * =opening]')。spinner({min:0,max:100}); 

$('#doorsize6w7h-f')。spinner()。change(function(){
alert($(this).spinner('value'));
});

html:

 code>< input type =textvalue =0class =frontid =doorsize6w7h-fname =opening [0] [0]/> 


解决方案

在调用<$您的文本框中的c $ c> change()。

  $('。ui-spinner-按钮')。click(function(){
$(this).siblings('input')。change();
});

jsFiddle



设置微调器后。


I'm trying to use the latest version of the jquery.ui.spinner.js . http://wiki.jqueryui.com/w/page/12138077/Spinner

The spinners are showing-up and updating the textboxes, but I'm having trouble figuring out how to capture the 'change' event. It triggers when you manually change the value in the textbox, but not when you use the spinner arrows.

jquery:

    $('input[name*="opening"]').spinner({ min: 0, max: 100});

    $('#doorsize6w7h-f').spinner().change(function(){
         alert($(this).spinner('value'));
    });

html:

<input type="text" value="0" class="front" id="doorsize6w7h-f" name="opening[0][0]" />

解决方案

Attach an event on the spinner controls that calls change() on your textbox.

$('.ui-spinner-button').click(function() {
   $(this).siblings('input').change();
});

jsFiddle.

After setting up the spinner.

这篇关于jquery.ui.spinner更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆