jquery: a safari bug?

2019-09-03 19:33发布

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条回答
我命由我不由天
2楼-- · 2019-09-03 19:46

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.

查看更多
登录 后发表回答