...

View Full Version : Please help with script



me4u2nv
01-22-2009, 09:27 PM
I am using a scroller script, which uses an external.htm file and the script is not showing on my site. Would anyone be able to tell why it isn't from the code? Thanks in advance...


<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 path to your external page:
var iframesrc="http://www.newhopebaptistdalton.com/external.htm"

//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="200px" height="175px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')

</script>


<html>
<body>

<div id="datacontainer" style="position:absolute;left:675px;top:110px;width:100%" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">

<!-- ADD YOUR SCROLLER CONTENT INSIDE HERE -->

<b>What's Hot</b></p>
<p align="left"><strong><font face="Arial"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
code encrypter</a>&nbsp;</small></font></strong><br>
<font face="Arial" size="2">Scramble the source of any chunk of code using
this unique script.</font></p>
<p align="left"><strong><font face="Arial"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
links</a>&nbsp;</small></font></strong><br>
<font face="Arial"><small>Bring attention to special links, by making them
flash!</small></font></p>
<p align="left"><small><strong><font face="Arial"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
Cursor</a>&nbsp;</font></strong></small><br>
<small><font face="Arial">Display a second, &quot;roaming&quot; cursor on your
page with this fun animation script.</font></small></p>
<p align="left"><font face="Arial"><strong><a href="http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm" target="_top"><small>Animated
Document title</small></a><br>
</strong><small>Animate into view your document's title!</small></font>

<!-- END SCROLLER CONTENT -->

</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=2

//Specify intial delay before scroller starts scrolling (in miliseconds):
var initialdelay=500

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="5px"
setTimeout("scrollDiv()",40)
}

if (window.addEventListener)
window.addEventListener("load", initializeScroller, false)
else if (window.attachEvent)
window.attachEvent("onload", initializeScroller)
else
window.onload=initializeScroller

</script>

</body>
</html>

freedom_razor
01-22-2009, 10:16 PM
Code you posted above is the content of external.htm, yes?

Have you put this in the page where you want the scroller to appear?


<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 path to your external page:
var iframesrc="external.htm"

//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="150px" height="150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"></iframe>')

</script>


If its there, please post a link to the page where it is not appearing.

me4u2nv
01-22-2009, 10:27 PM
Thank you for the reply.....yes, I have the script placed on the page where I want it to appear... I've uploaded the external.htm to my root folder and changed the link to reflect it on the page...I'm thinking maybe that's the problem? I'm not sure how to fix it though.... Actually someone else is working on our site and asked me about this. Thanks again... the site is here:

http://www.newhopebaptistdalton.com/nhbc.html

freedom_razor
01-22-2009, 10:39 PM
<div id="datacontainer" style="position:absolute;left:675px;top:110px;


Try changing position values of that div, for example [like it is in original external.htm]:
left:1px;top;10px;

me4u2nv
01-22-2009, 10:58 PM
Hey, I changed the values you suggested and now it's showing, but it's showing in the upper left corner...what we're wanting is to get it to scroll on top of the "Newest Announcements" on the right side and change the font color to white...I don't think the script works when those values are changed....confused

freedom_razor
01-22-2009, 11:06 PM
external.htm is the file that's being displayed on your page, in the IFRAME, if you want to change font color to white, do it in that file.
And where exactly it will display is controlled by the position of the IFRAME, so adjust it in the code of your main page - nhbc.html, adding for example style declaration for 'datamain' [the IFRAME id]


<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
#datamain {position:absolute; left:675px; top:110px;}
-->
</style>

me4u2nv
01-22-2009, 11:27 PM
Okay Freedom, we're going to try this shortly. Thank you for your help!

freedom_razor
01-22-2009, 11:49 PM
Just about that white font, in case you're wondering where to do it.
In external.htm


<div id="datacontainer" style="position:absolute;left:1px;top:10px;width:100%;color:#fff;"


Mind you, that doesn't change default links' color, but I suppose you can work on it now.

me4u2nv
01-22-2009, 11:54 PM
This worked great, but it's scrolling behind the image... any idea how to get it to scroll on top of the image? Thanks

freedom_razor
01-23-2009, 12:19 AM
You can either move whole section:


<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 path to your external page:
var iframesrc="external.htm"

//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="200px" height="175px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')

</script>

to the end of the document [just before </BODY>] or preferably use z-index style property to move IFRAME above all else:


<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}

#datamain {position:absolute; left:675px; top:110px; z-index:10;}
-->

</style>

me4u2nv
01-23-2009, 12:31 AM
Worked like a charm my friend, just need to align it up now.... you are MOST appreciated!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum