最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

JavascriptjQuery not executing in IE until the body of the page is moused over - Stack Overflow

programmeradmin0浏览0评论

I'm working on a new portfolio site at , and am using the experience to cut my teeth on jQuery. I'm using the latest build and jcarouselite along with the easing extension on my main page for a nifty carousel effect. It works fine in most browsers, but when I started testing in IE (7 and 8, haven't started optimizing for 6.5) I find that jQuery does not execute code as soon as the document is loaded. Rather, it seems to wait until one moves the mouse on to the body of html itself. This causes my carousel to display like a list and my main menu buttons to not render properly until the user moves the mouse. I used browsershots to check if it was only happening on my machine, but sadly not. Can anyone shed some light on this for me? I'm a novice with jQuery, and have only a bit more experience with javascript in general, although I am quite familiar with other ECMA languages such as Actionscript.

I would post the source, but the live preview of the post shows that it would try to render the HTML.

Thanks in advance.

I'm working on a new portfolio site at http://www.nitrohandsome., and am using the experience to cut my teeth on jQuery. I'm using the latest build and jcarouselite along with the easing extension on my main page for a nifty carousel effect. It works fine in most browsers, but when I started testing in IE (7 and 8, haven't started optimizing for 6.5) I find that jQuery does not execute code as soon as the document is loaded. Rather, it seems to wait until one moves the mouse on to the body of html itself. This causes my carousel to display like a list and my main menu buttons to not render properly until the user moves the mouse. I used browsershots to check if it was only happening on my machine, but sadly not. Can anyone shed some light on this for me? I'm a novice with jQuery, and have only a bit more experience with javascript in general, although I am quite familiar with other ECMA languages such as Actionscript.

I would post the source, but the live preview of the post shows that it would try to render the HTML.

Thanks in advance.

Share Improve this question edited Jun 22, 2011 at 17:14 demongolem 9,71636 gold badges97 silver badges105 bronze badges asked Apr 7, 2009 at 0:40 1
  • 1 by the way, to post code just indent it with 4 spaces – Paolo Bergantino Commented Apr 7, 2009 at 13:41
Add a ment  | 

1 Answer 1

Reset to default 11

You have an extra ma somewhere in your code. Check it for something like this:

{
 param: "whatever",
 param2: "whatever", // <- extra ma!
}

IE dies on these while Firefox does not.

EDIT: Here is the extra ma:

$("#carousel").jCarouselLite({
    btnNext: "#next",
    btnPrev: "#prev",
    visible: 3,
    easing: "easeout",
    speed: 150, // <- REMOVE THIS COMMA
});

SECOND EDIT:

For the sake of anyone that finds this page later on, the reason his page was not showing correctly was because of jQuery's 1.3.1 documented problems with document.ready firing after images or not at all. A fix to the latest jQuery version did the trick.

发布评论

评论列表(0)

  1. 暂无评论