.click在触摸设备上不起作用,尽管它适用于浏览器

时间:2015-02-23 14:51:42

标签: javascript android jquery html ios

.click在触控设备上不起作用,虽然它适用于浏览器!

我正在使用一个在浏览器上运行良好的.click功能,但是当我在触摸屏设备上试用它时,它不会工作(该功能甚至不会被调用)。当我选择一个选择选项时,应该调用该函数。是否有可能问题是选择选项上的触摸不被视为点击?在这种特定情况下,有没有办法将触摸用作点击?



$brandImageOptions.find('.selecter-item').click(function(){
            //The console.log won't work with a touch, but will work with a click
			console.log("This event is happening LOL WUT Right? RIGHT?!");
			//DO STUFF 

		});




我也尝试过:

$brandImageOptions.find('.selecter-item').on('click', function(){
            //The console.log won't work with a touch, but will work with a click
            console.log("This event is happening LOL WUT Right? RIGHT?!");
            //DO STUFF 

        });

$brandImageOptions.find('.selecter-item').on('click, touchstart', function(){
            //The console.log won't work with a touch, but will work with a click
            console.log("This event is happening LOL WUT Right? RIGHT?!");
            //DO STUFF 

        });

感谢帮助:)

html是:                                     MARCA

                                <div class="form-controls select-small">
                                    <select name="brands" id="brands" class="select">
                                        <option value=""></option>
                                        <option value="CHEVROLET">CHEVROLET</option>
                                        <option value="GMC">GMC</option>
                                        <option value="AC-DELCO">AC-DELCO</option>

                                    </select>
                                </div><!-- /.form-controls -->
                            </div><!-- /.form-group -->

0 个答案:

没有答案