开发者

jQuery & IE on Refresh/Reload

开发者 https://www.devze.com 2022-12-29 01:55 出处:网络
Basically I create a page with a jQuery scroller on it. However in IE7 specifically, on refresh all the li\'s on the page are shown full out

Basically I create a page with a jQuery scroller on it. However in IE7 specifically, on refresh all the li's on the page are shown full out then they hide and the scroller begins.

Anyone know how I can fire the jquery first, or prevent this from ha开发者_Go百科ppening.

Heres the code

<script language="JavaScript" src="/site/js/jquery-1.3.2.js"></script>
<script language="JavaScript" src="/site/js/jcarousellite_1.0.1c4.js"></script>
<script type="text/javascript">  
 $(document).ready(function() {
 $(".air_ticker").jCarouselLite({vertical: true,visible: 1,auto:10000,speed:1800});
  });  
</script>


Standard way: like this question

In your HTML:

<body>
  <script type="text/javascript">
    document.body.className += " js";
  </script>

In your CSS (loaded before the .air_ticker element appears in the HTML)

.js .air_ticker { display: none; }

Now, if the browser has JS, the .air_ticker element will be hidden before it has a chance to show.

0

精彩评论

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