PDA

View Full Version : script works in html page but not in php page Cross Browser marquee II ?



leonidassavvides
06-07-2007, 07:48 PM
http://www.dynamicdrive.com/dynamicindex2/cmarquee2.htm

script here needs html wepage extension or may run and to a php file extension ?

I try .php extension unsuccessfully ?

thetestingsite
06-07-2007, 07:57 PM
Seems to work fine for me:

http://phphost.smackum.com/dd/marquee.php

The source code for that page is as follows:



<html>

<head>
<style type="text/css">

#marqueecontainer{
position: relative;
width: 200px; /*marquee width */
height: 200px; /*marquee height */
background-color: white;
overflow: hidden;
border: 3px solid orange;
padding: 2px;
padding-left: 4px;
}

</style>

<script type="text/javascript">

/***********************************************
* Cross browser Marquee II- &#169; Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=2 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
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"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>
</head>

<body>

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98&#37;;">

<?php

for ($i=1; $i<=50; $i++) {
echo '<h4>This is test message '.$i.'</h4> <BR>';
}
?>
</div>
</div>

</body>
</html>


(Mostly taken off the DD "Developer's View" page).

A link to your problem page would help us to troubleshoot it as well.
Hope this helps.

leonidassavvides
06-07-2007, 08:04 PM
php page must be online or in test mode offline is ok ?

leonidassavvides
06-07-2007, 08:22 PM
is any way not this script take space [if text is much] to the view mode of the webpage in the editor ? now works thks

leonidassavvides
06-17-2007, 12:17 PM
The "Cross Browser marquee II" at http://www.pafoscarhire.com/index.php how can I center it in the cell (above big sub-table) ?