最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Bootstrap Touchspin OnChange event - Stack Overflow

programmeradmin3浏览0评论

I have the bootstrap touchspin input spinner initialized and I want to call a function whenever the button is pressed.

I tried this: $('#spinedit').trigger('touchspin.on.startspin', function () {alert("HI");});

However, it doesn't do anything.

Thanks

I have the bootstrap touchspin input spinner initialized and I want to call a function whenever the button is pressed.

I tried this: $('#spinedit').trigger('touchspin.on.startspin', function () {alert("HI");});

However, it doesn't do anything.

Thanks

Share Improve this question edited Dec 29, 2014 at 0:35 cvrebert 9,3092 gold badges40 silver badges49 bronze badges asked Dec 28, 2014 at 18:19 davids.1davids.1 1691 gold badge2 silver badges11 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

You are trying to trigger than bind the event touchspin.on.startspin to the element. The correct way to bind is

$('#spinedit').on('touchspin.on.startspin', function () {alert("HI");});

touchspin.on.startspin - Triggered when the spinner starts spinning upwards or downwards.

For other events you can see their docs(See Triggered events)

Fiddle Demo

发布评论

评论列表(0)

  1. 暂无评论