И так это скрипт бегущий строки как титры снизу вверх и при наведении на него мышки этот скрипт останавливается. Я в джаве 0. И мне просто нужно интегрировать пхп чтобы выплывающий текст выходил из базы данных MYSQL
Вот Джава:
</head>
<script type="text/javascript">
var marqueewidth="100%" //Specify the marquee's width (in pixels) (keep in mind any cell padding and images you may have in your themes).
var marqueeheight="150px" //Specify the marquee's height
var scrollinterval=50 // Specify the refresh rate. This affects speed too. Larger is slower.
var pauseit=1 //Pause marquee onMousever of text area (0=no. 1=yes)?
var marqueecontent=' ssss ';
var direction='up';
if (direction=='up') {
// Scroll upwards start
var marqueespeed=1 // Specify speed (larger is faster 1-10) This is the amount of pixel movement per refresh. 1 is best for smoothness.
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 iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, ns_marquee
function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualheight=cross_marquee.offsetHeight
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.top=parseInt(marqueeheight)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualheight=ns_marquee.document.height
}
lefttime=setInterval("scrollmarquee()",scrollinterval)
}
window.onload=populate
function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) {
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
}
else {
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}
}
else if (document.layers){
if (ns_marquee.top>(actualheight*(-1)+8)) {
ns_marquee.top-=copyspeed
}
else {
ns_marquee.top=parseInt(marqueeheight)+8
}
}
}
function scrolldown(){
copyspeed=marqueespeed-3;
}
function scrolldoubleup(){
copyspeed=marqueespeed+3;
}
var txt='';
if (iedom||document.layers){
with (document){
if (iedom){
txt+='<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'
txt+='<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;">'
txt+='</div></div>'
}
else if (document.layers){
txt+='<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">'
txt+='<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'
txt+='</ilayer>'
}
}
}
}
// Scroll upwards end
// Scroll downwards start
else {
var marqueespeed=-1 // Specify speed (larger is faster 1-10) This is the amount of pixel movement per refresh. 1 is best for smoothness.
marqueespeed=(document.all)? marqueespeed : -1
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, ns_marquee
function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualheight=cross_marquee.offsetHeight
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.top=parseInt(marqueeheight)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualheight=ns_marquee.document.height
}
lefttime=setInterval("scrollmarquee()",scrollinterval)
}
window.onload=populate
function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) {
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
}
else {
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}
}
else if (document.layers){
if (ns_marquee.top>(actualheight*(-1)+8)) {
ns_marquee.top-=copyspeed
}
else {
ns_marquee.top=parseInt(marqueeheight)+8
}
}
}
function scrollup(){
copyspeed=marqueespeed+3;
}
function scrolldoubledown(){
copyspeed=marqueespeed-3;
}
var txt='';
if (iedom||document.layers){
with (document){
if (iedom){
txt+='<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">'
txt+='<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:100%;">'
txt+='</div></div>'
}
else if (document.layers){
txt+='<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">'
txt+='<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>'
txt+='</ilayer>'
}
}
}
}
// Scroll downwards end
//-->
</script>
<body>
и вот что надо прописовать в ХТМЛ
<script type="text/javascript">document.write(txt);</script>
егуший текст нужно вписовать сюда:
var marqueecontent=' ssss ';
И когда туда происоваеш ПХП код, то не работает.
Вопрос в том, как сделать так чтоб ПХП код я мог поместить в ХТМЛ...
Замечу что простой ПХП код типа
<?php print "bla bla bla "; ?>
работает но сложный
var marqueecontent=' <?php
include("/home/moya_papka_bez_dirok/public_html/module_news/show_news.php");
?> ';
увы глюкает (( помагите а