Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript not working properly in Safari & Chrome

    I have an "animated slideshow" of 29 jpeg images on a page created using Javascript. It works fine in Internet Explorer and Firefox but not Safari or Chrome. The jpeg files names are 01.jpg through to 29.jpg. Here below is the code in the header and the body. There is an error in there somewhere:


    <html>
    <head>
    <title>My webpage</title>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
    <SCRIPT language="JavaScript" type="text/JavaScript">
    <!--
    var speed=1333;
    var counter = 1;
    function rollPics() {
    document.display.src=counter+".jpg"; //Display image "counter".jpg
    counter ++; // Add 1 to counter
    if (counter>29) { // If counter is greater than 29 images then reset it
    counter=1
    }
    }
    <!-- END -->
    </SCRIPT>
    </head>

    <body>
    <center>
    <table>
    <tr><td>
    <IMG NAME="display" SRC="1.jpg" onLoad="setTimeout('rollPics()',1333)">
    </td></tr>
    </table>
    </center>
    </body>
    </html>
    Last edited by vr100; 06-18-2010 at 04:34 PM. Reason: not complete anough

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,919
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    See:- *** WARNING: Questions posted here will be deleted! ***.
    You will not get any reply in this forum which is intended to be used only to
    post a completed (working) script for showcasing/benefit of others.


    You should also study the forum posting guidelines, especially about double posting and the use of [code] tags.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •