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
    Regular Coder
    Join Date
    Aug 2005
    Posts
    365
    Thanks
    7
    Thanked 1 Time in 1 Post

    auto scroll horizontal images

    I searched a lot for this but couldn't find the right thing. Can anyone tell me about any Image scroller with dynamic effects??? Links or examples ?

  • #2
    New Coder
    Join Date
    Nov 2006
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure if this what you're looking for, but it will scroll an image horizontally across the page. You can change the speed by modifying the numbers in bold.

    Code:
    <html>
    <head>
    <script>
    window.onload = window.setInterval(test,50);
    
    function test() {
    	var img = document.getElementById('moveImage');
    	var pos = parseInt(img.style.left);
    	var width = parseInt(img.style.width);
    	if ((pos+width)<0) {
    		img.style.left = (window.outerWidth-10)+'px';
    	} else {
    		img.style.left = (pos-5)+'px';
    	}
    }
    </script>
    </head>
    <body>
    <img id="moveImage" src="http://codingforums.com/images/buttons/reply.gif" style="position:absolute; left:10px; top:10px; height:90px; width:250px;">
    </body>
    </html>


  •  

    Posting Permissions

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