Vida Una Homepage
Forum Home Forum Home > Programación > Códigos JavaScript
  New Posts New Posts RSS Feed - Cambiar o Rotar varios banners
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Cambiar o Rotar varios banners

 Post Reply Post Reply
Author
Message
Programador View Drop Down
Expert@
Expert@
Avatar

Joined: 09 Mayo 2009
Location: San Pedro Alc.
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Programador Quote  Post ReplyReply Direct Link To This Post Topic: Cambiar o Rotar varios banners
    Posted: 09 Mayo 2009 at 3:20pm

<!-- Dentro del tag HEAD -->

<script LANGUAGE="JavaScript">
<!-- Creador:  Markus Fischer (mfischer@josefine.ben.tuwien.ac.at) -->
<!-- Sitio Web:  http://josefine.ben.tuwien.ac.at/~mfischer/ -->

<!-- Comienza
var mfBanners = [
['http://www.banner1-url-here.com', 'ban1.gif'],
['http://www.banner2-url-here.com', 'ban2.gif']
];
var mfIe = false;
if( document.all) {
mfIe = true;
}
var mfBannerIndex = 0;
function mfBannerChange() {
var htmlString = '<a target="_blank" href="'+mfBanners[mfBannerIndex][0]+'"> <img border="0" src="'+mfBanners[mfBannerIndex][1]+'"></a>';
if( mfIe) {
document.all.banner.innerHTML = htmlString;
}
else {
document.layers["banner"].document.open();
document.layers["banner"].document.write( htmlString);
document.layers["banner"].document.close();
}
if(mfBannerIndex < mfBanners.length - 1)
mfBannerIndex++;
else
mfBannerIndex = 0;
}
setInterval("mfBannerChange()", 3000);
//  End -->
</script>

<!-- Dentro del tag BODY -->

<div id="banner"></div>

Back to Top
Sponsored Links


Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.066 seconds.