PHP & JAV ASCRIPT

Cercando su internet un marquee in js nè ho trovati diversi nè ho

scelti 2 per la loro semplicità.

Premettendo che funziona l'inserimento di tag PHP con JS,la mi domanda è questa è possibile avere a video più banner ovvero vi spiego meglio

più descrizioni che vengano visualizzate una dopo l'altra, quale

istruzione mysql mi cosigliate per leggere da più righe ovvero da più record? :'(

Questo è il codice:

<? 
print("<html> 
<head> 
<meta name='author' content='sito realizzato da SalvioniA Cave - 
www.asalvioni.net'> 
<link href='style_AS.css' rel='stylesheet' type='text/css'> 
<title>Sito ...</title></head> 
<body>"); 
?> 
<? 
include "condb.php"; 


$selnew =  "select * from novita where idnew <> '0' and newpage = 'Si' 
order by titolo"; 


$querynew = mysql_query ($selnew,$connessione) 
                or die ("<span class='red'>Non riesco ad eseguire la 
richiesta, torna indietro</span>"); 
?> 
<script type="text/javascript"> 


/*****************************­****************** 
* Memory Scroller script- © Dynamic Drive DHTML code library 
(www.dynamicdrive.com) 
* This notice MUST stay intact for legal use 
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source 
code 
******************************­*****************/ 


var memorywidth="300px" //scroller width 
var memoryheight="20px" //scroller height 
var memorybgcolor="#DEFDD9" //scroller background 
var memorypadding="2px" //padding applied to the scroller. 0 for non. 
var borderCSS="border: 1px solid black;" //Border CSS, applied to 
scroller to give border. 


var memoryspeed=2 //Scroller speed (larger is faster 1-10) 
var pauseit=1 //Pause scroller onMousever (0=no. 1=yes)? 


var persistlastviewedmsg=1 //should scroller's position persist after 
users navigate away (1=yes, 0=no)? 
var persistmsgbehavior="onload" //set to "onload" or "onclick". 


//Specify the scroller's content (don't delete <nobr> tag) 
//Keep all content on ONE line, and backslash any single quotations 
(ie: that\'s great): 


<? 
$valnew = mysql_fetch_array ($querynew); 
                $titolo  = $valnew ["titolo"]; 
?> 


var memorycontent='<nobr><span style="font: bold 13px Verdana"><? echo 
$titolo ?></span></nobr>' 


////NO NEED TO EDIT BELOW THIS LINE//////////// 
var 
combinedcssTable="width:"+(par­seInt(memorywidth)+6)+"px;back­ground-color:"+memorybgcolor+"­;padding:"+memorypadding+";"+b­orderCSS+";" 
var combinedcss="width:"+memorywid­th+";height:"+memoryheight+";" 


var divonclick=(persistlastviewedm­sg && persistmsgbehavior=="onclick")­? 
'onClick="savelastmsg()" ' : '' 
memoryspeed=(document.all)? memoryspeed : Math.max(1, memoryspeed-1) 
//slow speed down by 1 for NS 
var copyspeed=memoryspeed 
var pausespeed=(pauseit==0)? copyspeed: 0 
var iedom=document.all||document.g­etElementById 
if (iedom) 
document.write('<span id="temp" 
style="visibility:hidden;posit­ion:absolute;top:-100px;left:-­10000px">'+memorycontent+'</sp­an>') 
var actualwidth='' 
var memoryscroller 


if (window.addEventListener) 
window.addEventListener("load"­, populatescrller, false) 
else if (window.attachEvent) 
window.attachEvent("onload", populatescroller) 
else if (document.all || document.getElementById) 
window.onload=populatescroller 


function populatescroller(){ 
memoryscroller=document.getEle­mentById? 
document.getElementById("memor­yscroller") : document.all.memoryscroller 
memoryscroller.style.left=pars­eInt(memorywidth)+8+"px" 
if (persistlastviewedmsg && get_cookie("lastscrollerpos")!­="") 
revivelastmsg() 
memoryscroller.innerHTML=memor­ycontent 
actualwidth=document.all? temp.offsetWidth : 
document.getElementById("temp"­).offsetWidth 
lefttime=setInterval("scrollma­rquee()",20) 



} 


function get_cookie(Name) { 
var search = Name + "=" 
var returnvalue = "" 
if (document.cookie.length > 0) { 
offset = document.cookie.indexOf(search­) 
if (offset != -1) { 
offset += search.length 
end = document.cookie.indexOf(";", offset) 
if (end == -1) 
end = document.cookie.length; 
returnvalue=unescape(document.­cookie.substring(offset, end)) 


} 
} 
return returnvalue; 
} 


function savelastmsg(){ 
document.cookie="lastscrollerp­os="+memoryscroller.style.left 


} 


function revivelastmsg(){ 
lastscrollerpos=parseInt(get_c­ookie("lastscrollerpos")) 
memoryscroller.style.left=pars­eInt(lastscrollerpos)+"px" 


} 


if (persistlastviewedmsg && persistmsgbehavior=="onload") 
window.onunload=savelastmsg 

function scrollmarquee(){ 
if (parseInt(memoryscroller.style­.left)>(actualwidth*(-1)+8)) 
memoryscroller.style.left=pars­eInt(memoryscroller.style.left­)-copyspeed+"px" 
else 
memoryscroller.style.left=pars­eInt(memorywidth)+8+"px" 



} 


if (iedom){ 
with (document){ 
document.write('<table border="0" cellspacing="0" cellpadding="0" 
style="'+combinedcssTable+'"><­td>') 
write('<div style="position:relative;overf­low:hidden;'+combinedcss+'" 
onMouseover="copyspeed=pausesp­eed" 
onMouseout="copyspeed=memorysp­eed">') 
write('<div id="memoryscroller" 
style="position:absolute;left:­0px;top:0px;" '+divonclick+'></div>') 
write('</div>') 
document.write('</td></table>'­) 

} 
} 


</script>

:bye:

inviato 11 anni fa
EKELON77
X 0 X
Effettua l'accesso o registrati per rispondere a questa domanda