...

View Full Version : Can someone help quick



VoSs
08-04-2008, 06:26 AM
I am trying to cycle these images but I cannot figure out whats wrong. Help would be greatly appreciated.


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Banner Cycler</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
var curBanner="adImage1";
var changeBanner;
function changeAds() {
if (curBanner == "adImage2")
document.this.src="adImage2.gif";
curBanner="adImage2";
if (curBanner =="adImage3")
document.this.src="adImage4.gif";
curBanner="adImage4";
if (curBanner == "adImage4")
document.this.src="adImage5.gif";
curBanner="adImage5";
if (curBanner=="adImage5")
document.this.src=adImage1.gif";
curBanner="adImage1";
}

// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>

<body onload="var changeBanner=setInterval('changeAds()',5000);">
<p><img src="adImage1.gif" name="banner" alt="Cycling Banners" /></p>
<p><img src="adImage2.gif" name="banner" alt="Cycling Banners" /></p>
<p><img src="adImage3.gif" name="banner" alt="Cycling Banners" /></p>
<p><img src="adImage4.gif" name="banner" alt="Cycling Banners" /></p>
<p><img src="adImage5.gif" name="banner" alt="Cycling Banners" /></p>
</body>
</html>

ninnypants
08-04-2008, 06:35 AM
Try this code that I have from and earlier post (http://www.codingforums.com/showthread.php?t=145310)

Lady_Gladiaor
08-04-2008, 07:31 PM
I am trying to cycle these images but I cannot figure out whats wrong. Help would be greatly appreciated.


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Banner Cycler</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
var curBanner="adImage1";
var changeBanner;
function changeAds() {
if (curBanner == "adImage2")
document.this.src="adImage2.gif";
curBanner="adImage2";
if (curBanner =="adImage3")
document.this.src="adImage4.gif";
curBanner="adImage4";
if (curBanner == "adImage4")
document.this.src="adImage5.gif";
curBanner="adImage5";
if (curBanner=="adImage5")
document.this.src=adImage1.gif";
curBanner="adImage1";
}

// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>

<body onload="var changeBanner=setInterval('changeAds()',5000);">
<p><img src="adImage1.gif" name="banner" alt="Cycling Banners" /></p>
<p><img src="adImage2.gif" name="banner" alt="Cycling Banners" /></p>
<p><img src="adImage3.gif" name="banner" alt="Cycling Banners" /></p>
<p><img src="adImage4.gif" name="banner" alt="Cycling Banners" /></p>
<p><img src="adImage5.gif" name="banner" alt="Cycling Banners" /></p>
</body>
</html>

--------------------------------------------------------------------------

Try the code below:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>
<title>Cycling Banner</title>

<script type="text/javascript">
<!--

var curBanner="image1";

function changeBanner()
{

if (curBanner == "image2")
{
document.images[0].src = "adImage1.gif";
curBanner = "image1";
}
else if (curBanner == "image3")
{
document.images[0].src = "adImage2.gif";
curBanner = "image2";
}
else if (curBanner == "image4")
{
document.images[0].src = "adImage3.gif";
curBanner = "image3";
}
else if (curBanner == "image5")
{
document.images[0].src = "adImage4.gif";
curBanner = "image4";
}
else
{
document.images[0].src = "adImage5.gif";
curBanner = "image5";
}

}


-->
</script>

<style type="text/css">

body {
background:#FFFFFF;
color:#000000;
}
</style>


</head>

<body onload="var begin=setInterval('changeBanner()',5000);">

<p><img src="adImage1.gif" id="adBanner" alt="Ad Banner" /> </p>

</body>

</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum