|
|
|
| Мне надо как marquee, только вертикально. Чтоб крутилось безостановочно. И, желательно, чтобы выравнивание можно было бы применить разное в разных случаях. | |
|
|
|
|
|
|
|
для: Eugene77
(29.04.2007 в 20:03)
| |
<!--
Example for KLayers project
http://www.kruglov.ru/klayers/
(c) Kruglov S.A. 2002
-->
<script src="klayers.js"></script>
<script>
var KS=[] // array for scrollings
var KScounter=0
function KScrolling(text,width,height,speed){
if(text.length && text.join){
text=text.join("<br>")
}
this.number=KScounter++
this.width=width
this.height=height
this.speed=speed
this.text=text+"<br>"+text;
KS[this.number]=this
}
KScrolling.prototype.print=function(){
if(isMSIE || isMozilla || isOpera5){
return ("<div id='KSborder"+this.number+"' style='width: "+this.width+"px;height: "+this.height+"px;overflow: hidden'><div id='KStext"+this.number+"' style='position: relative; top: 0px; left: 0px; visibility: hidden'>"+this.text+"</div></div>")
}else if(isNC4){
return "<ilayer name='KSNN"+this.number+"' visibility='hide'><spacer type=block width="+this.width+" height="+this.height+"></ilayer>\n"+
"<layer name='KStext"+this.number+"' clip='0 0 "+this.width+" "+this.height+"' top=0 left=0 visibility='hide'>"+this.text+"</layer>"
}else{
return (this.text)
this.badBrowser=true
}
}
KScrolling.prototype.scroll=function(){
if(this.badBrowser) return
if(!this.layer) {
this.layer=layer("KStext"+this.number)
if(isNC4){
var l=layer("KSNN"+this.number)
this.layer.moveTo(this.left=l.getAbsoluteLeft(),this.top=l.getAbsoluteTop())
}
this.layer.show()
this.offset=0
}else{
this.offset=(this.offset+1)%(this.layer.getHeight()/2)
if(isNC4){
this.layer.scroll(this.left,this.top,this.width,this.height,0,this.offset)
}else if(!this.badBrowser){
this.layer.moveY(-this.offset)
}
}
setTimeout("KS["+this.number+"].scroll()",this.speed)
}
</script>
<script>
S=new KScrolling("Cross browser scrolling example",60,60,32)
</script>
<table cellspacing=0 cellpadding=2 border=2 width=1 height=1>
<tr><td>
<script>
document.write(S.print())
</script>
</td></tr>
</table>
<script>
if(isNC4){
onload=function(){S.scroll()}
}else{
S.scroll();
}
</script>
|
хотя я делала гораздо проще, но не уверена, что везде одинаково смотрится (всякие оперы меня не волнуют):
<SCRIPT LANGUAGE="JavaScript">
document.write('<marquee id="iescroller" direction="up" width="150" height="170" scrollamount="1" scrolldelay="30" onmouseover="this.stop()" onmouseout="this.start()" style="background-color:#ffffcc">');
iescroller.onmouseover=new Function("iescroller.scrollAmount=0");
iescroller.onmouseout=new Function("iescroller.scrollAmount=2");
document.write('<table cellspacing=0 cellpadding=0 border=0 width=150 align="center"><tr><td valign=top align=center>')
document.write("<br>текст 1<br> текст 2<br>");
document.write('</td></tr></table>');
document.write('</marquee>');
</script>
|
тексты можно таскать из базы... | |
|
|
|