Solved

rolling image

Posted on 2004-09-25
4
888 Views
Last Modified: 2012-06-27
Hi,
I need a js that would change 2 or 3 images based on time (seconds).  More like a banner or so.
0
Comment
Question by:omanca
4 Comments
 
LVL 2

Author Comment

by:omanca
ID: 12149637
ok, I found an answer from google search.  I closed the site and forgot the address.  Here it is anyway

<html>
<head>
<script>
var banners = new Array(
      '1.gif',
      '2.gif');
var linx = new Array(
      'intro.html',
      'intro.html');
var old = 0;
var current = 0;

function init()
{
      if (!document.images) return
      while (current == old)
      {
            current = Math.floor(Math.random()*banners.length);
      }
      old = current;
      document.images['banner'].src = banners[current];
      setTimeout('init()',2000);
}

function sendPage()
{
      location.href = linx[current];
}
</script>
</head>

<body onload="init()">
<a href="javascript:sendpage()"><img
      src="1.gif" name="banner"
      width=100 height=18 border=0></a>
</body>
</html>
0
 
LVL 1

Expert Comment

by:srini5474
ID: 12150045
i rather suggest u to use ADRotator unction in this case, i think this link would help u how to use ADRotator Effeciently

http://www.w3schools.com/aspnet/control_adrotator.asp

Regards,
Srinivasan S
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12554196
PAQed with points refunded (50)

modulo
Community Support Moderator
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question