开发者

jQuery in wordpress works bad in ie8

I want 开发者_如何学JAVAto develop simple slideshow in WordPress with jQuery. It works nice in all browsers except IE.

var blockShow = function(element,nav,duration) {
  //alert(element);
  container = jQuery(element); // but in this function throw error: Object doesn't support this property or method
}

// this works
jQuery(document).ready(
  function() {
    if(jQuery('#header-slideshow')) {
      blockShow('#header-slideshow');
    }
  }
);

UPDATE: I forgot to say: outside WP it working perfectly. In IE and everywhere else, so it have to be something in WP.


from my experience if something is not working in ie, but is everywhere else, its one of 2 things.

1 - you have some syntax slightly wrong somewhere - mayde invalid html (try validating your html and css http://validator.w3.org/) an extra comma or something. Other browsers tend to be better at ignoring minor syntax bugs

2 - you have some kind of conflict with wordpress' existing scripts. Try reorganising the load orders.

without seeing the actual site, the only other thing I can recommend is to back up your template, and systematically delete wordpress elements one by one until it works! It helps identify the problem code.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜