function scrollLoop(s){this.speed=s;}
function scrollLayer(){
if(parseInt(this.elem.style.top)>(this.elem.offsetHeight*(-1))){
this.elem.style.top=parseInt(this.elem.style.top)-this.speed+'px';
}else{
this.elem.style.top=this.initH+'px';
}
}
function getElement(){
this.elem=document.getElementById(this.name);
}
function createLayer(){
document.write('<div id="layer'+this.name+'" style="position:relative;overflow:hidden;float:');
document.write(this.initFl+';background-color:#'+this.initBg+';border:0px solid black;width:');
document.write(this.initW+'px;height:'+this.initH+'px;" onmouseover="');
document.write(this.name+'.scrollLoop(0)" onmouseout="'+this.name+'.scrollLoop(');
document.write(this.speed+')">');
document.write('<div id="'+this.name+'" style="position:absolute;top:');
document.write(this.initH+'px;left:0px;border:0px solid black;width:');
document.write(this.widthB+'px;height:'+this.heightB+'px;background-color:#');
document.write(this.Bg+'">');
document.write(this.content);
document.write('<\/div><\/div>');
if(this.scrollLayer){this.timer=setInterval(this.name+'.scrollLayer()','30');}
}//]]>
</SCRIPT>
โค๊ดquery รูปจากฐานข้อมูล
<?
$pagelen=14;
$range=5;
if(empty($_GET['page'])){ $page=1;}
$sql_g="select * from logo order by level asc";
$result_gl=get_rsltset($sql_g);
echo $nr_img=count($result_gl); มันได้นับ 11รูป