Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 移动设备选择选项的事件_Jquery_Html_Mobile - Fatal编程技术网

Jquery 移动设备选择选项的事件

Jquery 移动设备选择选项的事件,jquery,html,mobile,Jquery,Html,Mobile,我正在尝试从mobile上的select标记绑定选项上的事件,但是click事件处理程序中的代码不起作用,我不知道为什么 我认为点击不是这个特定标签的正确事件 $('.show-select option').on('click',function() { console.log('pressed radio select') $(this).siblings().find('option').attr('selected',false) showNumber = par

我正在尝试从mobile上的select标记绑定选项上的事件,但是click事件处理程序中的代码不起作用,我不知道为什么

我认为点击不是这个特定标签的正确事件

$('.show-select option').on('click',function() {
    console.log('pressed radio select')
    $(this).siblings().find('option').attr('selected',false)
    showNumber = parseInt($('.show-select option').filter(':selected').val().substr(5));
    if($('.show-select option#all').text() === "All") {
        showNumber = Infinity;
    }
    filterByBreed();
    breederAnimate();
    $('.breeder').not('.active').find('.breeder_breed_desc').each( animateBreeds )
})
那个控制台日志永远不会运行。我做错了什么

我认为点击不是这个特定标签的正确事件

$('.show-select option').on('click',function() {
    console.log('pressed radio select')
    $(this).siblings().find('option').attr('selected',false)
    showNumber = parseInt($('.show-select option').filter(':selected').val().substr(5));
    if($('.show-select option#all').text() === "All") {
        showNumber = Infinity;
    }
    filterByBreed();
    breederAnimate();
    $('.breeder').not('.active').find('.breeder_breed_desc').each( animateBreeds )
})
当然是
单击
不是正确的下拉事件

您需要使用
change
事件进行下拉,而不是
单击

$('.show-select').on('change',function() {
...............
...............