Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2000
    Messaggi
    19

    javascript per banner -- aiuto ---------------------------------------------

    Salve,

    Ho preso dal sito questo script per la rotazione di banner (vedi sotto).
    Tale script fa ruotare un numero x di immagini, compresi i link per ognuna.
    Siccome ho molti banner da far ruotare, mi servirebbe di inserire 2
    gruppi di rotazione;esempio, se ho 50 banner, il primo gruppo parte da 0 mentre il secondo parte da 25 a visualizzare.
    (nell'esempio sotto facciamo che parte il primo da 0 e il secondo da 3)

    Inoltre altro problema di questo script è che se clicco sul link, me lo apre dentro allo stesso frame\finestra ...mentre io vorrei che mi aprisse una nuova finestra di explorer.

    Qualcuno gentilmente mi puo' modificare lo script ?

    grazie
    -------------------------------------


    <HTML>
    <HEAD>

    <!-- Codice scaricato gratuitamente da HTML.it, il sito italiano sul Web publishing
    http://www.html.it -->

    <TITLE>Esempi Javascript: esempio pratico </TITLE>

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Hide from JavaScript-Impaired Browsers
    /* First, if you load fewer or more than 6 sponsors
    into your rotator, change the "sponnr" variable
    to the actual number of sponsor .gifs you plan to
    load. */
    number_of_sponsors=6;

    var sctr=0;
    var halt=0;
    var isn=new Array();
    for (i=0;i<number_of_sponsors;i++){
    isn[i]=new Image();
    }

    /* The sponsor .gif names are loaded into the isn[x]
    sponsor images array. You may load any number of
    sponsor images (.gif or .jpg or both) into this
    array. They must all be the same size, however.
    Substitute your own .gif filenames for the ones
    shown here. Note that the first .gif must appear
    in the isn[0] array element. */
    isn[0].src="siti_geo.gif";
    isn[1].src="siti_har.gif";
    isn[2].src="siti_htm.gif";
    isn[3].src="siti_mid.gif";
    isn[4].src="siti_fol.gif";
    isn[5].src="siti_nas.gif";

    /* Finally, replace the URL's below with those of
    your sponsors IN THE SAME ORDER. */
    var durl=new Array();
    durl[0]="http://www.geocities.com/~nicolarandone/geoguide/";
    durl[1]="http://www.hwupgrade.com";
    durl[2]="http://www.html.it";
    durl[3]="HTTP://WWW.INTERACTIVA.IT/USERS/MATTEO/MIDILAND/INDEX.HTM";
    durl[4]="http://www.geocities.com/SiliconValley/Peaks/5080/";
    durl[5]="http://www.pegacity.it/informatica/nasi.com/";

    /* This script is set to rotate every 10 seconds.
    (5000=5 seconds, so 30000 would equal 30, etc)
    You should change the number in the setTimeout()
    call below for the number of seconds you wish. */
    function rotateIt(){
    if (halt!=1){
    sctr++;
    if (sctr>number_of_sponsors-1){
    sctr=0;
    }
    document.sponsor.src=isn[sctr].src;
    setTimeout("rotateIt()",10000);
    }
    }

    /* This code will work just fine with or without
    frames. However, if you are in frames and wish
    to replicate the TARGET="_top" call to remove
    frames, change the location.href call to:
    parent.location.href=durl[sctr];
    below. */
    function doIt(){
    halt=1;
    location.href=durl[sctr];
    }

    function dispIt(){
    parent.window.status=durl[sctr];
    }
    // End Hiding -->
    </SCRIPT>

    </HEAD>

    <BODY bgcolor="white">

    <CENTER><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
    <TR><TD><A HREF="npgspo.htm" onClick="doIt();return false" onMouseover="dispIt();return true;">
    [img]siti_htm.gif[/img]</TD></TR>
    </TABLE></CENTER>

    <!-- Or, you may wish to have content appear here below
    the rotating sponsor banners.

    IMPORTANT!!! - This little script below is necessary
    right at the bottom of your HTML to begin the sponsor
    banner rotation: -->
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Hide JavaScript from Java-Impaired Browsers
    sctr=0;
    rotateIt();
    // End Hiding -->
    </SCRIPT>


    </body>
    </html>


  2. #2
    Utente di HTML.it L'avatar di Xinod
    Registrato dal
    Sep 2000
    Messaggi
    13,649
    x la nuova finestra sostituisci a
    location.href=durl[sctr];

    window.open(durl[sctr],'_blank','');

    ciao

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2000
    Messaggi
    19
    Grazie molte ..

    spero qualcuno riesca a risolvermi il problema
    della seconda immagina di banner rotante

    GRAZIW

  4. #4
    Bello il codice, lo potrei sfuttare. Però, se uno volesse semplicmente che il nuovo banner comparisse al prossimo reload della pagina, come bisogna procedere?

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2000
    Messaggi
    19
    cercalo su html.it ..mi pare di aver visto quello script

    ...qualcuno risolva il mio prob

    mille grazie

  6. #6
    Utente di HTML.it
    Registrato dal
    Dec 2000
    Messaggi
    19
    Oppure mi andrebbe anche bene che ad ogni entrata/refresh
    ..il conteggio dei banner inizia da un valore diverso.
    Al momento inizia sempre da 1

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.