Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13

Discussione: Rotazione Banner

  1. #1

    Rotazione Banner HELP

    Ciao ragazzi, seguendo le istruzioni trovate in una guida in questo sito che riguardava la rotazione dei banner ho trovato delle difficoltà..il codice sembra perfetto ma quando entro nella index.html del mio sito visualizzo solo [AD] senza vedere la rotazione dei miei 3 banner inseriti

    vi stampo qui il codice di index.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript" language="javascript">
    <!--
    function loadpage() {
    browver= parseInt(navigator.appVersion);
    browtype = navigator.appName;
    browsertype = "old";
    if (browtype == "Netscape" && !(browver < 3)) {
    browsertype = "new";
    }
    if (browtype == "Microsoft Internet Explorer" && !(browver < 4)) {
    browsertype = "new";
    }
    if (browsertype == "new") {
    thetimer = setTimeout("changeimage()", 3000);
    banneradcode = 0;
    listofimages = new Array(3);
    listofimages[0] = new Image(468,60)
    listofimages[0].src = "banner-0.gif"
    listofimages[1] = new Image(468,60)
    listofimages[1].src = "banner-1.gif"
    listofimages[2] = new Image(468,60)
    listofimages[2].src = "banner-2.gif"
    }
    }

    function changeimage(){
    if (browsertype == "new") {
    banneradcode = banneradcode + 1
    if (banneradcode == "3") {
    banneradcode = 0
    }
    imagesource = "banner-" + banneradcode + ".gif"
    window.document.bannerad.src = imagesource
    thetimer = setTimeout("changeimage()", 5000);
    }
    else if (browsertype == "old") {
    }
    }

    function changepage() {
    if (browsertype == "new") {
    if (banneradcode == 0) {
    newlocation = "http://www.html.it"
    }
    else if (banneradcode == 1) {
    newlocation = "http://www.html.it"
    }
    else if (banneradcode == 2) {
    newlocation = "http://www.html.it"
    }
    location = newlocation
    }
    else if (browsertype == "old") {
    location = "http://www.html.it"
    }
    }
    // --></script>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Documento senza titolo</title>
    </head>

    <body bgcolor="white" vlink="blue" link="blue" onload="loadpage()">

    <a href="javascript:changepage()">
    [img]banner-0.gif[/img]
    </a>
    </body>
    </html>

    Le immagini hanno lo stesso nome...Non riesco a capire il perchè mi visualizza [AD]

    Grazie in anticipo x l'aiuto! ;-)

  2. #2
    Scusatemi! funziona il codice..molto probabilmente il sito d hosting free che ho io nn ha abilitato il javascript!

    ho un'altra domanda da fare xrò!

    con il codice che ho usato quando clicco sul banner mi carica la pagina cn l'indirizzo d destinazione del banner, ma io vorrei che cliccando sul banner mi apra il sito su un'altra finestra senza caricare il sito sulla stessa finestra..come posso modificarlo il codice?

    ho provato ad aggiungere nel tag <a in fondo il target="blank" ma non funziona perchè mi apre un'altra finestra ma vuota..senza il link che dovrebbe avere!


    Grazie x l'aiuto!

  3. #3
    Devi usere il comando window.open() invece del comando location

    window.open (newlocation,"mywindow");
    invece di

    location=newlocation


  4. #4
    xfetto!! funziona! ^_^ grazie mille!

  5. #5

  6. #6
    mi è sorto un'altro problema ragazzi!
    Teoricamente questo codice mi permetteva la rotazione di 3 banner posizionati in fondo al sito...e se io volessi dedicare anche una parte laterale del sito per la rotazione dei banner come posso fare? devo rifare tutto il codice un'altra volta?

  7. #7
    codice:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript" language="javascript">
    <!--
    function loadpage() {
    browver= parseInt(navigator.appVersion);
    browtype = navigator.appName;
    browsertype = "old";
    if (browtype == "Netscape" && !(browver < 3)) {
    browsertype = "new";
    }
    if (browtype == "Microsoft Internet Explorer" && !(browver < 4)) {
    browsertype = "new";
    }
    if (browsertype == "new") {
    thetimer = setTimeout("changeimage()", 3000);
    
    thetimer2 = setTimeout("changeimage2()", 3000);
    
    banneradcode = 0;
    bannercode2=0;
    
    listofimages = new Array(3);
    listofimages[0] = new Image(468,60)
    listofimages[0].src = "banner-0.gif"
    listofimages[1] = new Image(468,60)
    listofimages[1].src = "banner-1.gif"
    listofimages[2] = new Image(468,60)
    listofimages[2].src = "banner-2.gif"
    
    listofimages2 = new Array(3);
    listofimages2[0] = new Image(468,60)
    listofimages2[0].src = "banner2-0.gif"
    listofimages2[1] = new Image(468,60)
    listofimages2[1].src = "banner2-1.gif"
    listofimages2[2] = new Image(468,60)
    listofimages2[2].src = "banner2-2.gif"
    }
    }
    
    function changeimage(){
    if (browsertype == "new") {
    banneradcode = banneradcode + 1
    if (banneradcode == "3") {
    banneradcode = 0
    }
    imagesource = "banner-" + banneradcode + ".gif"
    window.document.bannerad.src = imagesource
    thetimer = setTimeout("changeimage()", 5000);
    }
    else if (browsertype == "old") {
    }
    }
    function changeimage2(){
    if (browsertype == "new") {
    banneradcode2 = banneradcode2 + 1
    if (banneradcode2 == "3") {
    banneradcode2 = 0
    }
    imagesource = "banner-" + banneradcode2 + ".gif"
    window.document.bannerad2.src = imagesource
    thetimer = setTimeout("changeimage()", 5000);
    }
    else if (browsertype == "old") {
    }
    }
    
    function changepage() {
    if (browsertype == "new") {
    if (banneradcode == 0) {
    newlocation = "http://www.html.it"
    }
    else if (banneradcode == 1) {
    newlocation = "http://www.html.it"
    }
    else if (banneradcode == 2) {
    newlocation = "http://www.html.it"
    }
    location = newlocation
    }
    else if (browsertype == "old") {
    location = "http://www.html.it"
    }
    }
    function changepage2() {
    if (browsertype == "new") {
    if (banneradcode2 == 0) {
    newlocation = "http://www.html.it"
    }
    else if (banneradcode2 == 1) {
    newlocation = "http://www.html.it"
    }
    else if (banneradcode2 == 2) {
    newlocation = "http://www.html.it"
    }
    location = newlocation
    }
    else if (browsertype == "old") {
    location = "http://www.html.it"
    }
    }
    // --></script> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Documento senza titolo</title>
    </head>
    
    <body bgcolor="white" vlink="blue" link="blue" onload="loadpage()">
    
    
    
    <a href="java-script:changepage()">
    [img]banner-0.gif[/img]
    </a>
    
    
    <a href="java-script:changepage2()">
    [img]banner2-0.gif[/img]
    </a>
    
    </body>
    </html>
    così dovrebbe andare

  8. #8
    enno nn mi funziona...mettendo il codice che mi hai dato te non mi ruota piu neanche quello di prima che avevo infondo... ti rimetto il codice leggermente sistemato cm l'ho fatto io

    <script type="text/javascript" language="javascript">
    <!--
    function loadpage() {
    browver= parseInt(navigator.appVersion);
    browtype = navigator.appName;
    browsertype = "old";
    if (browtype == "Netscape" && !(browver < 3)) {
    browsertype = "new";
    }
    if (browtype == "Microsoft Internet Explorer" && !(browver < 4)) {
    browsertype = "new";
    }
    if (browsertype == "new") {
    thetimer = setTimeout("changeimage()", 3000);

    thetimer2 = setTimeout("changeimage2()", 3000);

    banneradcode = 0;
    bannercode2=0;

    listofimages = new Array(3);
    listofimages[0] = new Image(468,60)
    listofimages[0].src = "banner-0.gif"
    listofimages[1] = new Image(468,60)
    listofimages[1].src = "banner-1.gif"
    listofimages[2] = new Image(468,60)
    listofimages[2].src = "banner-2.gif"

    listofimages2 = new Array(3);
    listofimages2[0] = new Image(140,400)
    listofimages2[0].src = "banner2-0.gif"
    listofimages2[1] = new Image(140,400)
    listofimages2[1].src = "banner2-1.gif"
    listofimages2[2] = new Image(140,400)
    listofimages2[2].src = "banner2-2.gif"
    }
    }

    function changeimage(){
    if (browsertype == "new") {
    banneradcode = banneradcode + 1
    if (banneradcode == "3") {
    banneradcode = 0
    }
    imagesource = "banner-" + banneradcode + ".gif"
    window.document.bannerad.src = imagesource
    thetimer = setTimeout("changeimage()", 5000);
    }
    else if (browsertype == "old") {
    }
    }
    function changeimage2(){
    if (browsertype == "new") {
    banneradcode2 = banneradcode2 + 1
    if (banneradcode2 == "3") {
    banneradcode2 = 0
    }
    imagesource = "banner-" + banneradcode2 + ".gif"
    window.document.bannerad2.src = imagesource
    thetimer = setTimeout("changeimage2()", 5000);
    }
    else if (browsertype == "old") {
    }
    }

    function changepage() {
    if (browsertype == "new") {
    if (banneradcode == 0) {
    newlocation = "http://www.html.it"
    }
    else if (banneradcode == 1) {
    newlocation = "http://www.html.it"
    }
    else if (banneradcode == 2) {
    newlocation = "http://www.html.it"
    }
    location = newlocation
    }
    else if (browsertype == "old") {
    location = "http://www.html.it"
    }
    }
    function changepage2() {
    if (browsertype == "new") {
    if (banneradcode2 == 0) {
    newlocation = "http://www.google.it"
    }
    else if (banneradcode2 == 1) {
    newlocation = "http://www.google.it"
    }
    else if (banneradcode2 == 2) {
    newlocation = "http://www.google.it"
    }
    location = newlocation
    }
    else if (browsertype == "old") {
    location = "http://www.google.it"
    }
    }
    // --></script>


    _________________________BANNER LATERALE(140x400)____________________________

    <a href="java-script:changepage2()">
    [img]banner2-0.gif[/img]
    </a>



    ________________________BANNER SOTTO (468x60)______________________________


    <div align="center"><a href="javascript:changepage()">
    [img]banner-0.gif[/img]
    </a> </div>

  9. #9
    function changeimage2(){
    if (browsertype == "new") {
    banneradcode2 = banneradcode2 + 1
    if (banneradcode2 == "3") {
    banneradcode2 = 0
    }
    imagesource = "banner-" + banneradcode2 + ".gif"
    window.document.bannerad2.src = imagesource
    thetimer2 = setTimeout("changeimage2()", 5000);
    }
    else if (browsertype == "old") {
    }
    }

  10. #10
    in questo caso le varie gif di ogni banner che ruoteranno devo metterli nella cartella principale del sito giusto?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.