开发者

js works in opera, but do not works in any other browser

开发者 https://www.devze.com 2023-03-14 23:06 出处:网络
There is a animation after click on the marker. Why this works in Opera, but do not work in any other browser? Is it something with rendering engines presto and webkit? I can\'t solve it myself, pleas

There is a animation after click on the marker. Why this works in Opera, but do not work in any other browser? Is it something with rendering engines presto and webkit? I can't solve it myself, please help.

http://turie.eu/02/

(all of the code is in one index.开发者_C百科html file)


When trying with Chromium I get this error:

Uncaught TypeError: Object http://turie.eu/02/clouds.swf has no method 'click'

To simulate a click event you need to do something like this:

function fireEvent(element, event){
  if (document.createEventObject){
    /* for IE */
    return element.fireEvent('on' + event, document.createEventObject());
  }else{
    /* for other browsers */
    var evt = document.createEvent('HTMLEvents');
    evt.initEvent(event, true, true);
  }
  return !element.dispatchEvent(evt);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消