Hepple
01-18-2007, 08:09 PM
1) Script Title: IFRAME scroller
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/iframe-scroller.htm
3) Website: http://www.callus.cc/v2
4) Describe problem: It works perfectly in Firefox but not IE. It shows up my content, but does not scroll. I do receive an error in IE in the bottom left hand corner where it says "Done". The error is as follows;
Error: 'dataobj.style' is null or not an object
I have a good idea that the problem lies in the java script in my linked file. Here's the source code;
<?php
function gigs()
{
include_once("mysql.php");
include_once("bbcode.php");
$db2 = new db;
$db2->connect();
$sql = "SELECT * FROM mygigs_gigs WHERE Active='1' ORDER BY Post_Date ASC";
$return = $db2->query($sql);
while ( $row = mysql_fetch_array($return) )
{?>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
font-size: 11px;
}
body {
background-color: #0B0B0B;
margin-left: 5px;
}
.style1 {font-size: 11px}
.style2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #990000;
}
.style3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
color: #FFFFFF;
}
-->
</style>
<div id="datacontainer" style="position:absolute" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="5" colspan="2"></td>
</tr>
<tr>
<td> </td>
<td width="816" valign="bottom"><span class="style2"><strong><?php echo @stripslashes($row[gigs_Title]); ?></strong></span></td>
</tr>
<tr>
<td> </td>
<td class="style3"><?php
$Text = @stripslashes($row[gigs_Body]);
$mytext = BBcode($Text);
echo $mytext;
?></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
</table>
<?php }
} // end of function gigs
?>
</div>
<script type="text/javascript">
/***********************************************
* IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed=cache=1
//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=5000
function initializeScroller(){
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
dataobj.style.top="5px"
setTimeout("getdataheight()", initialdelay)
}
function getdataheight(){
thelength=dataobj.offsetHeight
if (thelength==0)
setTimeout("getdataheight()",10)
else
scrollDiv()
}
function scrollDiv(){
dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
if (parseInt(dataobj.style.top)<thelength*(-1))
dataobj.style.top="70px"
setTimeout("scrollDiv()",100)
}
if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller
</script>
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/iframe-scroller.htm
3) Website: http://www.callus.cc/v2
4) Describe problem: It works perfectly in Firefox but not IE. It shows up my content, but does not scroll. I do receive an error in IE in the bottom left hand corner where it says "Done". The error is as follows;
Error: 'dataobj.style' is null or not an object
I have a good idea that the problem lies in the java script in my linked file. Here's the source code;
<?php
function gigs()
{
include_once("mysql.php");
include_once("bbcode.php");
$db2 = new db;
$db2->connect();
$sql = "SELECT * FROM mygigs_gigs WHERE Active='1' ORDER BY Post_Date ASC";
$return = $db2->query($sql);
while ( $row = mysql_fetch_array($return) )
{?>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
font-size: 11px;
}
body {
background-color: #0B0B0B;
margin-left: 5px;
}
.style1 {font-size: 11px}
.style2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #990000;
}
.style3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
color: #FFFFFF;
}
-->
</style>
<div id="datacontainer" style="position:absolute" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="5" colspan="2"></td>
</tr>
<tr>
<td> </td>
<td width="816" valign="bottom"><span class="style2"><strong><?php echo @stripslashes($row[gigs_Title]); ?></strong></span></td>
</tr>
<tr>
<td> </td>
<td class="style3"><?php
$Text = @stripslashes($row[gigs_Body]);
$mytext = BBcode($Text);
echo $mytext;
?></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
</table>
<?php }
} // end of function gigs
?>
</div>
<script type="text/javascript">
/***********************************************
* IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
//Specify speed of scroll. Larger=faster (ie: 5)
var scrollspeed=cache=1
//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=5000
function initializeScroller(){
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
dataobj.style.top="5px"
setTimeout("getdataheight()", initialdelay)
}
function getdataheight(){
thelength=dataobj.offsetHeight
if (thelength==0)
setTimeout("getdataheight()",10)
else
scrollDiv()
}
function scrollDiv(){
dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
if (parseInt(dataobj.style.top)<thelength*(-1))
dataobj.style.top="70px"
setTimeout("scrollDiv()",100)
}
if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller
</script>