View Full Version : how to rotate the links using javascript?
gdhanasekar
May 7th 2006, 11:32 pm
how to rotate the links using javascript?
regards !!
gdhanasekar
http://www.webmaster-directory.net
kk5st
May 8th 2006, 1:17 am
Google is your friend (http://www.google.com/search?q=how+to+rotate+the+links+using+javascript&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official). Note the search terms.
cheers,
gary
-Abhishek-
May 8th 2006, 5:41 am
What sort of Link rotation do you want ??
On refresh or Text Box Rotation ??
Check this Code ... simple one ;) Link Box rotation ...
<SCRIPT LANGUAGE="JavaScript">
<!--
function makeArray(q){
for(i=1 ; i < q ; i++){this[i]=0}}
w=1;
howmanysites=4; // Number of sites listed Below
Sites = new makeArray(howmanysites);
Sites[1] = "http://www.abhishektripathi.com|Abhishek's Blog!";
//put yoursites then | and what you want the box to show here's where I got the orig.
Sites[2] = "http://forums.digitalpoint,cin|The Best Forum!";
Sites[3] = "http://www.secmate.com|Get PayPal Verified!";
Sites[4] = "http://www.twinkhost.net|Free Hosting No Ads!";
function showSites() {
if (w > howmanysites) { w=1; };
var string=Sites[w] + "";
var split=string.indexOf("|");
var url=string.substring(0,split);
var word=string.substring(split + 1,string.length);
document.form.url.value=url;
document.form.word.value=word;
w+=1;
window.setTimeout('showSites()',1500);
}
function visitSite() {
window.location=document.form.url.value;
}
// End -->
</SCRIPT>
</head>
<BODY>
<center>
<form name=form>
<table><tr><td align=center>
<input type=hidden name=url value="">
<input type=text name=word value="" onFocus="visitSite()" size=40>
</td></tr></table>
</form>
</center>
<script>
showSites();
</script>
<P>
Hope it helps ....
-Abhishek-
May 8th 2006, 5:43 am
A quick Demo Here (http://www.abhishektripathi.com/js.htm)
Abhishek
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.