tags:

views:

71

answers:

2

i am using http://malsup.com/jquery/cycle/

with jquery

my code is

       <script>
      $(document).ready(function(){     

       $("div.hide1").fadeTo("slow", 0.13);
        $("div.hide1").fadeTo("slow", 1);

        $('.caption').cycle({
    fx:      'fade', 
        speedIn:  2500, 
        speedOut: 500, 
         sync:     0, 
         timeout: 10000,
     delay:0,
     });
       </script>

div for that like this...

       <div class="caption" style=" position:absolute; margin-top:0px">
   <img src="cap/img1.png" />
   <img src="cap/img2.png" />
   <img src="cap/img3.png" />
   <img src="cap/img4.png" />
   <img src="cap/img5.png" />
   <img src="cap/img6.png" />
    </div>

and include file is like this.

this work fine for Firefox, Safari but not working with Internet Explorer 7

A: 
Try <script type="text/javascript"> instead of <script>.

Also, look at IE's error console to see if there are any js errors.

Does it work in IE8 or IE6 or even Opera/Safari/Chrome?

CodeJoust
+4  A: 

When you specify an object in json, don't put a comma after the last element.

e.g. the following doesn't work in IE:

obj = {
  "e1": 1,
  "e2": 2, // note the comma here
   }

This should work:

obj = {
  "e1": 1,
  "e2": 2 // no comma
   }

In your code, you have delay:0, I believe that's where the problem is; just remove that comma

hasen j
Good call. FF (and perhaps other browsers) will gladly (but incorrectly) accept the trailing comma. IE6-8 (and perhaps more) will not.
pst
hehe, I've been bit by this before (a lot, actually).
hasen j
Most languages allow such construct. I guess IE is the exception.
RichN