Ако някои може да даде??

Maricha

Registered
Може ли някои да даде Java Script kod от един бар да излиза някакъв текст?Като дата.бг
 
100% го има тука http://www.dynamicdrive.com/ , сега не мога да каже къде точно е (нямам време в момента) потърси си го сам.
 
Може да го препишеш от самата дата.бг.
Сега ще погледна как са го направили и ще ти го дам.
 
Код:
<script LANGUAGE="JavaScript1.2">
var pagewidth, stylescript;
pagewidth=500; stylescript=500;
document.write("<table border='0' cellspacing='5' cellpadding='0' width='"+(pagewidth+122)+"' align='center'><tr><td align='center' width='100%' valign='top'>");
</script>

<script language="JavaScript1.2">
var marqueewidth=pagewidth-230;
var marqueeheight="14px"; var marqueespeed=1;
var marqueebgcolor=""; var pauseit=1;
var iedom=document.all||document.getElementById;
var marqueecontent='<nobr>От 15.01.2006 всички потребители, чиито основни снимки са нереални 
ще бъдат премахвани от галерията на Data.BG. ;</nobr>';
if (iedom) document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-100000px">'+marqueecontent+'</span>');
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 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"><div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"><div id="iemarquee" style="position:absolute;left:0px;top:0px"></div></div></div>'); }
		else if (document.layers){ write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'><layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer></ilayer>') }
	    document.write('</td></table>');
        }
}
</script>

Това в червеното може да го редактираш както намериш за добре.
 
ЕДИТ:

Код:
<script language="JavaScript1.2">
var pagewidth, stylescript; 
pagewidth=900; stylescript=500; 
var marqueewidth=pagewidth-230;
var marqueeheight="14px"; var marqueespeed=1;
var marqueebgcolor=""; var pauseit=1;
var iedom=document.all||document.getElementById;
var marqueecontent='<nobr><font class="submenu">От 15.01.2006 всички потребители, чиито основни снимки са нереални ще бъдат премахвани от галерията на Data.BG. Ако имате повече от 1 снимка в профила си и поне 1 реална снимка, посочете реалната като основна (под снимките има бутон "Основна"). <font color=\'red\'>Това се отнася само за галерията на Data.BG, а не за останалите услуги.</font>    |    </font></nobr>';
if (iedom) document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-100000px">'+marqueecontent+'</span>');
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 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"><div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"><div id="iemarquee" style="position:absolute;left:0px;top:0px"></div></div></div>'); }
		else if (document.layers){ write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'><layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer></ilayer>') }
	    document.write('</td></table>');
        }
}
</script>
 
Пич би ли ми казал как това да го вкарам да се показва на бара??Нещo не става???
 
АМа пи4 кажи как да го сложа в bara????
виж:
....
<tr height="2">
<td class="menu" colspan="17" align="center" height="2" valign="middle"></td>
</tr>
</tbody>
</table>
<p><img src="images/bar2.jpg" width="1000" height="30"></p>
<table align="center" border="0" cellpadding="0" cellspacing="5" width="1002">
<tbody>
<tr>
.....
Ето там където пише "images/bar2.jpg/ как да го вмъкна и да застане по него и да върви??А пи4 кажи
 
Просто пробвай да вмъкнеш целия скрипт някъде примерно след
<p><img src="images/bar2.jpg" width="1000" height="30"></p>
и виж какво ще стане.
 
а защо изобщо използваш JS за това ?
я пробваи с <marquee>
Код:
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title></title>
</head>

<body>
<marquee loop="-1">Полезни материали за уеб-програмиране! Всичко за вашите домейн имена ! </marquee>
</body>
</html>
 

Горе