Results 1 to 4 of 4

Thread: Scrolling Image Continuously

  1. #1

    Thread Starter
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158

    Question

    Hi, can any one show me with code how I may be able to scroll an image across the page continuously.

    I've seen it on a website and wish to do something similar for a site I'm doing for a friend.

    Her is were I saw it:
    http://www.kenneallycreative.com/

    THANKS IN ADVANCE

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It uses JavaScript and DHTML to scroll it along. Just right click on the image and choose "View Source".
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158
    Yeh I kind of already did that, the problem is that as I'm new to JavaScropt and that, I need to know which code belongs to scrolling the image and which is for other bit's. Can some just show me the part which does the scrolling so that I may be able to apply it to my own image.

    THANKS IN ADVANCE

  4. #4
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    this is the function which makes the image scroll:

    Code:
    function tick() {
    
    if (ver ==3) return
    
    if (ns){
            document.first.offset(-pix,0);
    
            document.second.offset(-pix,0);
    
            if (document.first.left <= again) document.first.left = ImgWidth;
    
            if (document.second.left <= again) document.second.left = ImgWidth;
            }
    else {
            newpix = document.all["first"].style.pixelLeft - pix;
            newpix2 = document.all["second"].style.pixelLeft - pix;
    
            document.all["first"].style.pixelLeft = newpix;
    
            document.all["second"].style.pixelLeft = newpix2;
    
            if (document.all["first"].style.pixelLeft <= again) document.all["first"].style.pixelLeft = ImgWidth;
    
            if (document.all["second"].style.pixelLeft <= again) document.all["second"].style.pixelLeft = ImgWidth;
            }       
    
            setTimeout('tick()', time);
    }

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

Posting Permissions

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



Click Here to Expand Forum to Full Width