Javascript örneği:Kayan Yazı

Konu sahibi son olarak 562 gün önce görüldü
Html kodları sayesinde kayan yazımızın durumunu değiştirebiliriz.Ama javascript ilede bu yazıya daha canlı slayt haline getirebiliriz.Javascript ile kayan yazı örneği aşağıdadır.Kolay gelsin.

<table border=”0″ cellspacing=”0″ cellpadding=”0″ width=”380″>
<tr>
<td width=”20″ height=”20″><img src=”sol.gif” onmouseover=”leftScroll();” style=”cursor:hand;” width=”20″ height=”20″></td>
<td valign=”bottom”>
<script language=JavaScript1.2>
var marqueewidth=350
var marqueeheight=17
var speed= 5
var durum=”left”
var marqueecontents=”<div onmouseover=stopScroll(); onmouseout=startScroll();> ”
marqueecontents+=”Kayacak olan yazı bu kısma yazılır”
marqueecontents+=”</div>”
function startScroll() {
idyakis.scrollAmount=5;
}
function stopScroll() {
idyakis.scrollAmount=0;
}
function leftScroll() {
idyakis.direction=”left”;
}
function rightScroll() {
idyakis.direction=”right”;
}
if (document.all)
document.write(‘<marquee name=”namayakis” id=”idyakis” direction=’+durum+’ scrollAmount=’+speed+’ style=”width:’+marqueewidth+’;height:’+marqueeheig ht+’”>’+marqueecontents+’</marquee>’)
</script>
</td>
<td width=”20″ height=”20″><img onmouseover=”rightScroll();” style=”cursor:hand;” src=”ok_sag.gif” width=”20″ height=”20″></td>
</tr></table>
 
Geri