jquery: a safari bug?

落花浮王杯 提交于 2019-12-25 14:40:59

问题


Can anyone tell me why this page causes a strange problem on Safari? If you click on any of the boxs on Safari, you will get a multiple alerts or countless alerts.

This is only a simple jquery code,

$(document).ready(function(){

    $('.tile-item').click(function(){
        alert('0');
    });

});

It should just alert one alert box on each click like other browsers (even IE works ok too!)

How can I fix this?

Thanks.

EDIT:

I tested it on Windows 7 Safari 5.0.5 (7533.21.1)

Any has checked it on their Windows?

Thanks.


回答1:


Clicking on the alert box will click through it and click the box in the background. You can test this by placing the alert box away from your boxes.

The trick is not to use alert for testing your code works.

if you need to display data try the jQuery dialog from jQuery UI.



来源:https://stackoverflow.com/questions/6005752/jquery-a-safari-bug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!