views:

61

answers:

1

This code working fine in FF but giving error in IE

object expected error line 1 char 1

jquery code

$(function () {
    $('#header_images img:gt(0)').hide();
    setInterval(function () {
        $('#header_images :first-child').fadeOut().next('img').fadeIn().end().appendTo('#header_images');
    }, 3000);
});

this is added in external.js file.

Edit: 7 September

This is how i added the JavaScript in <head>

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>

This code which i added in question , is in script.js as it is

A: 

this is how I'm using similar code without any issues:

$(function() {
            $('#slideshow img:gt(0)').hide();
            setInterval(function(){
              $('#slideshow :first-child').fadeOut('slow')
                 .next('img').fadeIn('slow')
                 .end().appendTo('#slideshow');}, 
              4000);
});
Moin Zaman
yours and mine code looks same. but i'm getting error
metal-gear-solid
mine has an extra semi-colon. can you replace your code with mine and try?
Moin Zaman
also is this the only code you have in your dom ready? it could something before this.
Moin Zaman
No i have this code directly in external javascript file.
metal-gear-solid
Now i'm using this `$(document).ready(function(){$(function() { $('#header_images img:gt(0)').hide(); setInterval(function(){ $('#header_images :first-child').fadeOut('slow') .next('img').fadeIn('slow') .end().appendTo('#header_images');}, 4000);});});` but error still here
metal-gear-solid