+ Reply to Thread
Results 1 to 6 of 6

Thread: Javascript Image Changer

  1. #1
    seaside is offline x10Hosting Member seaside is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    14

    Javascript Image Changer

    I have a div on my homepage and I have several images (lets say 5) that I would like to go there. I would like to know how to put one image there and in 8 seconds it changes to the next and then the next etc. then start over. Can anybody help me?

  2. #2
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: Javascript Image Changer

    I am currently using this one:
    http://www.gruppo4.com/~tobia/cross-slide.shtml

  3. #3
    seaside is offline x10Hosting Member seaside is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    14

    Re: Javascript Image Changer

    Thats pretty cool, but i mean simpler. Just an image that changes with a transition every 8 seconds. Could you or anybody provide some code?

  4. #4
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: Javascript Image Changer

    well here is an example for the above site. to me its simple and satisfies your needs (transitions and change every 8 seconds)

    HTML Code:
    <head>
    <script type="text/javascript" src="path/to/jquery.js"></script>
    <script type="text/javascript" src="path/to/jquery.cross-slide.js"></script>
    </head>
    <body>
    <script type="text/javascript">
       jQuery(function() {
          jQuery('#imgHold').crossSlide({
          sleep: 7.5,
          fade: .5
       }, [
           { src: 'path/to/img1.png' },
           { src: 'path/to/img2.png' },
           { src: 'path/to/img3.png' },
           { src: 'path/to/img4.png' },
           { src: 'path/to/img5.png' }
        ]);
     });
    </script>
    <div id="imgHold">Text here will not show up if a user has JavaScript turned on. May be used for error messages: "Javascript is turned off, please turn it on to view the slideshow"</div>
    </body>

    it stays on the image for 7.5 seconds (sleep) and fades in .5 seconds (fade)
    Last edited by diabolo; 10-16-2009 at 03:02 PM.

  5. #5
    seaside is offline x10Hosting Member seaside is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    14

    Re: Javascript Image Changer

    Oh ok thanks!

  6. #6
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Javascript Image Changer

    For diabolo's solution, you have to download the jQuery js libraries and then upload them to your site.
    Nothing is always absolutely so.

+ Reply to Thread

Similar Threads

  1. [REQ] [1500¢] Javascript Image Slideshow
    By kbjradmin in forum The Marketplace
    Replies: 12
    Last Post: 02-20-2009, 05:42 AM
  2. Javascript Image Mapping help
    By votter in forum Programming Help
    Replies: 3
    Last Post: 06-20-2008, 09:27 PM
  3. XML and Javascript
    By cuteboytm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 09-21-2007, 10:00 AM
  4. errors while attaching
    By mattspec in forum Feedback and Suggestions
    Replies: 0
    Last Post: 12-19-2005, 01:50 PM
  5. November Desktop
    By n4tec in forum Off Topic
    Replies: 12
    Last Post: 11-08-2005, 07:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers