Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 16
  1. #1

    Scrolling verticale, anzichè orizzontale

    Salve a tutti,
    qualcuno sarebbe così gentile da spiegarmi quale parametro modificare affinchè lo scrolling delle notizie, attinte da un db attraverso questo script, sia verticale e non orizzontale?




    Grazie anticipatamente, D.


    codice:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@LANGUAGE="VBSCRIPT"%>
    
    <%
    Dim rsNotizia
    Dim rsNotizia_numRows
    
    Set rsNotizia = Server.CreateObject("ADODB.Recordset")
    rsNotizia.ActiveConnection = MM_connNews_STRING
    rsNotizia.Source = "SELECT * FROM TabNews ORDER BY ID DESC"
    rsNotizia.CursorType = 0
    rsNotizia.CursorLocation = 2
    rsNotizia.LockType = 1
    rsNotizia.Open()
    
    rsNotizia_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index
    
    Repeat1__numRows = 5
    Repeat1__index = 0
    rsNotizia_numRows = rsNotizia_numRows + Repeat1__numRows
    %>
    
    <%
    Dim MM_paramName 
    %>
    <%
    ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
    
    Dim MM_keepNone
    Dim MM_keepURL
    Dim MM_keepForm
    Dim MM_keepBoth
    
    Dim MM_removeList
    Dim MM_item
    Dim MM_nextItem
    
    ' create the list of parameters which should not be maintained
    MM_removeList = "&index="
    If (MM_paramName <> "") Then
      MM_removeList = MM_removeList & "&" & MM_paramName & "="
    End If
    
    MM_keepURL=""
    MM_keepForm=""
    MM_keepBoth=""
    MM_keepNone=""
    
    ' add the URL parameters to the MM_keepURL string
    For Each MM_item In Request.QueryString
      MM_nextItem = "&" & MM_item & "="
      If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
        MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
      End If
    Next
    
    ' add the Form variables to the MM_keepForm string
    For Each MM_item In Request.Form
      MM_nextItem = "&" & MM_item & "="
      If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
        MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
      End If
    Next
    
    ' create the Form + URL string and remove the intial '&' from each of the strings
    MM_keepBoth = MM_keepURL & MM_keepForm
    If (MM_keepBoth <> "") Then 
      MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
    End If
    If (MM_keepURL <> "")  Then
      MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
    End If
    If (MM_keepForm <> "") Then
      MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
    End If
    
    ' a utility function used for adding additional parameters to these strings
    Function MM_joinChar(firstItem)
      If (firstItem <> "") Then
        MM_joinChar = "&"
      Else
        MM_joinChar = ""
      End If
    End Function
    %>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Testo scorrevole</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    a:link {text-decoration:none}
    a:visited {text-decoration:none}
    a:hover {text-decoration:none}
    </style>
    </head>
    
    <body>
    <center>
      
      <script language="JavaScript1.2">
    //Specify the marquee's width (in pixels)
    var marqueewidth="180px"
    //Specify the marquee's height
    var marqueeheight="200px"
    //Specify the marquee's marquee speed (larger is faster 1-10)
    var marqueespeed=2
    //configure background color:
    var marqueebgcolor="#DEFDD9"
    //Pause marquee onMousever (0=no. 1=yes)?
    var pauseit=1
    
    //Specify the marquee's content (don't delete <nobr> tag)
    //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):
    var marqueecontent='<nobr><font face="Verdana" size="2"><% 
    While ((Repeat1__numRows <> 0) AND (NOT rsNotizia.EOF)) 
    %>*** ***"><%=(rsNotizia.Fields.Item("Titolo").Value)%><% 
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      rsNotizia.MoveNext()
    Wend
    %></font></nobr>'
    
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
    var copyspeed=marqueespeed
    var pausespeed=(pauseit==0)? copyspeed: 0
    var iedom=document.all||document.getElementById
    if (iedom)
    document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
    var actualwidth=''
    var cross_marquee, ns_marquee
    
    function populate(){
    if (iedom){
    cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
    cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
    cross_marquee.innerHTML=marqueecontent
    actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
    }
    else if (document.layers){
    ns_marquee=document.ns_marquee.document.ns_marquee2
    ns_marquee.left=parseInt(marqueewidth)+8
    ns_marquee.document.write(marqueecontent)
    ns_marquee.document.close()
    actualwidth=ns_marquee.document.width
    }
    lefttime=setInterval("scrollmarquee()",20)
    }
    window.onload=populate
    
    function scrollmarquee(){
    if (iedom){
    if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
    cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
    else
    cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
    
    }
    else if (document.layers){
    if (ns_marquee.left>(actualwidth*(-1)+8))
    ns_marquee.left-=copyspeed
    else
    ns_marquee.left=parseInt(marqueewidth)+8
    }
    }
    
    if (iedom||document.layers){
    with (document){
    document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
    if (iedom){
    write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
    write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
    write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
    write('</div></div>')
    }
    else if (document.layers){
    write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
    write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
    write('</ilayer>')
    }
    document.write('</td></table>')
    }
    }
    </script>
      
    </center>
    </body>
    </html>
    <%
    rsNotizia.Close()
    Set rsNotizia = Nothing
    %>

  2. #2
    Utente di HTML.it L'avatar di lucalicc
    Registrato dal
    Sep 2002
    Messaggi
    6,926
    Per risolvere il problema devi analizzare e modificare
    il codice javascript che visualizza le news e non il
    codice asp, che estrae i dati da visualizzare dal database.
    Chiedi nel forum di javascript.
    luca
    www.intheweb.it - Internet solutions

  3. #3
    Grazie Luca,
    provo a linkare il 3d nella sezione che mi hai suggerito!

    Saluti, D.

  4. #4
    Utente di HTML.it L'avatar di lucalicc
    Registrato dal
    Sep 2002
    Messaggi
    6,926
    di nulla alle prox
    luca
    www.intheweb.it - Internet solutions

  5. #5
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,131
    Originariamente inviato da damiafix
    Grazie Luca,
    provo a linkare il 3d nella sezione che mi hai suggerito!

    Saluti, D.
    Meglio se chiedi il trasferimento (link segnala ad un moderatore) è vietato il cross-post
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  6. #6
    Ciao cavicchiandrea,
    grazie della segnalazione, ho provveduto a comunicare la cosa al moderatore, sono in attesa che il 3d venga spostato!

    Grazie, D.

  7. #7
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,131
    usa questo http://www.dynamicdrive.com/dynamicindex2/cmarquee2.htm i commenti dell'autore non vanno tolti
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  8. #8
    Lo scroller per il quale mi hai inviato il link è stupendo, grazie! Però io ho un probelma, quello di attingere i dati da un db access attorno al quale esiste un sistema di autenticazione, per l'inserimento delle news. C'è modo di modificare quest'ultimo, al fine che il contenuto sia preso da un db esterno?

    Grazie mille!!!

  9. #9
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,131
    al posto di:

    ci metti un inclusione del link esterno.
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  10. #10
    Grazie, ho creato un file MarqueeII.asp che contiene il seguente codice:

    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" lang="en" xml:lang="en">
    <head>
    <title>Dynamic Drive DHTML Scripts- Cross Browser marquee II</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="description" content="Click here for a cross browser marquee">
    <meta name="keywords" content="marquee, DHTML, JavaScript">
    <link rel="stylesheet" type="text/css" href="../ddincludes/mainstyle.css" />
    <style type="text/css">
    
    #marqueecontainer{
    position: relative;
    width: 200px; /*marquee width */
    height: 200px; /*marquee height */
    background-color: green;
    overflow: hidden;
    border: 3px solid orange;
    padding: 2px;
    padding-left: 4px;
    }
    
    </style>
    
    <script type="text/javascript">
    
    /***********************************************
    * Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for this script and 100s more.
    ***********************************************/
    
    var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
    var marqueespeed=2 //Specify marquee scroll speed (larger is faster 1-10)
    var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    
    var copyspeed=marqueespeed
    var pausespeed=(pauseit==0)? copyspeed: 0
    var actualheight=''
    
    function scrollmarquee(){
    if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
    cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
    else
    cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
    }
    
    function initializemarquee(){
    cross_marquee=document.getElementById("vmarquee")
    cross_marquee.style.top=0
    marqueeheight=document.getElementById("marqueecontainer").offsetHeight
    actualheight=cross_marquee.offsetHeight
    if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
    cross_marquee.style.height=marqueeheight+"px"
    cross_marquee.style.overflow="scroll"
    return
    }
    setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
    }
    
    if (window.addEventListener)
    window.addEventListener("load", initializemarquee, false)
    else if (window.attachEvent)
    window.attachEvent("onload", initializemarquee)
    else if (document.getElementById)
    window.onload=initializemarquee
    
    
    </script>
            </head>
    <body>
    <div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
    <div id="vmarquee" style="position: absolute; width: 98%;">
    
    
    
    <h3>Your scroller contents</h3>
    
         
    
    </div>
    </div>
            </body>

    nell'ultima parte ho incluso il file connNews.asp che contiene il seguente codice di collegamento con il database:

    codice:
    <%
    ' FileName="Connection_ado_conn_string.htm"
    ' Type="ADO" 
    ' DesigntimeType="ADO"
    ' HTTP="true"
    ' Catalog=""
    ' Schema=""
    Dim MM_connNews_STRING
    MM_connNews_STRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/prove/news.mdb")
    %>
    se faccio partire il file MarqueeII.asp ho il riquadro con lo scorrimento della frase "Your scroller contents" ma nulla che rimanda al database, anche se la connessione con il database avviene, in quanto se provo a modificare il percorso, appare un messaggio di errore, che scorre insieme al contenuto predefinito, forse è necessario che inserisca altro codice per specificare cosa estrapolare dal db e visualizzare!

    Grazie, D.

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 © 2024 vBulletin Solutions, Inc. All rights reserved.