做项目时遇到一个问题,在select标签里面设置了一些备选值,然后点击下拉框选择的时候,还没选好值,下拉框就迅速消失。
由于点击下拉框之后,事件被冒泡了。
所以只需要阻止继续冒泡即可
$('.walking_fov').click(function (e) { e.stopPropagation(); });