PDA

View Full Version : IFRAME scroller - No breaks



vbjohn
12-11-2009, 09:11 PM
1) Script Title: IFRAME scroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/iframe-scroller.htm

3) Describe problem: Is there a way that I can make it without whitespace from the last item to the first item? A constent scrolling with no breaks. Thank you.

ddadmin
12-12-2009, 07:03 AM
There's no easy way to do this at the moment unfortunately.

jscheuer1
12-12-2009, 03:46 PM
You may want to consider switching to:

http://home.comcast.net/~jscheuer1/side/marquee.htm

Use your browser's 'view source' to get the code.

Any questions, feel free to ask.

vwphillips
12-12-2009, 05:10 PM
or


<html>
<body>

<div style="position:absolute;left:1px;top:10px;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="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
code encrypter</a>&nbsp;</small></font></strong><br>
<font face="Verdana" size="2">Scramble the source of any chunk of code using
this unique script.</font></p>
<p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
links</a>&nbsp;</small></font></strong><br>
<font face="Verdana"><small>Bring attention to special links, by making them
flash!</small></font></p>

<p align="left"><small><strong><font face="Verdana"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
Cursor</a>&nbsp;</font></strong></small><br>
<small><font face="Verdana">Display a second, &quot;roaming&quot; cursor on your
page with this fun animation script.</font></small></p>
<p align="left"><font face="Verdana"><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>
<br />
<br />
<!-- 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.getElementsByTagName('DIV')[0]];
dataobj[0].style.top="5px"
setTimeout("getdataheight()", initialdelay)
}

function getdataheight(){
thelength=dataobj[0].offsetHeight
if (thelength==0)
setTimeout("getdataheight()",10)
else
dataobj[1]=dataobj[0].cloneNode(true);
dataobj[1].style.top=thelength+5+'px';
document.body.appendChild(dataobj[1]);
scrollDiv()
}

function scrollDiv(){
for (var z0=0;z0<dataobj.length;z0++){
dataobj[z0].style.top=parseInt(dataobj[z0].style.top)-scrollspeed+"px"
if (parseInt(dataobj[z0].style.top)<thelength*(-1))
dataobj[z0].style.top=parseInt(dataobj[z0].style.top)+thelength*2+"px"
}
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>

vbjohn
12-13-2009, 09:49 PM
or


<html>
<body>

<div style="position:absolute;left:1px;top:10px;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="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
code encrypter</a>&nbsp;</small></font></strong><br>
<font face="Verdana" size="2">Scramble the source of any chunk of code using
this unique script.</font></p>
<p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
links</a>&nbsp;</small></font></strong><br>
<font face="Verdana"><small>Bring attention to special links, by making them
flash!</small></font></p>

<p align="left"><small><strong><font face="Verdana"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
Cursor</a>&nbsp;</font></strong></small><br>
<small><font face="Verdana">Display a second, &quot;roaming&quot; cursor on your
page with this fun animation script.</font></small></p>
<p align="left"><font face="Verdana"><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>
<br />
<br />
<!-- 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.getElementsByTagName('DIV')[0]];
dataobj[0].style.top="5px"
setTimeout("getdataheight()", initialdelay)
}

function getdataheight(){
thelength=dataobj[0].offsetHeight
if (thelength==0)
setTimeout("getdataheight()",10)
else
dataobj[1]=dataobj[0].cloneNode(true);
dataobj[1].style.top=thelength+5+'px';
document.body.appendChild(dataobj[1]);
scrollDiv()
}

function scrollDiv(){
for (var z0=0;z0<dataobj.length;z0++){
dataobj[z0].style.top=parseInt(dataobj[z0].style.top)-scrollspeed+"px"
if (parseInt(dataobj[z0].style.top)<thelength*(-1))
dataobj[z0].style.top=parseInt(dataobj[z0].style.top)+thelength*2+"px"
}
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>


Thanks.

How can I close the gap... just a bit more?

vwphillips
12-14-2009, 09:30 AM
there is no gap, the content div is duplicated and both are scrolled.

for no gap the original div content height must be greater than the the parent div height by duplicating the HTML within the Div.


<html>
<body>

<div style="position:absolute;left:1px;top:10px;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="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
code encrypter</a>&nbsp;</small></font></strong><br>
<font face="Verdana" size="2">Scramble the source of any chunk of code using
this unique script.</font></p>
<p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
links</a>&nbsp;</small></font></strong><br>
<font face="Verdana"><small>Bring attention to special links, by making them
flash!</small></font></p>

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

<p align="left"><small><strong><font face="Verdana"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
Cursor</a>&nbsp;</font></strong></small><br>
<small><font face="Verdana">Display a second, &quot;roaming&quot; cursor on your
page with this fun animation script.</font></small></p>
<p align="left"><font face="Verdana"><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>
<br />
<br />
<!-- 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.getElementsByTagName('DIV')[0]];
dataobj[0].style.top="5px"
setTimeout("getdataheight()", initialdelay)
}

function getdataheight(){
thelength=dataobj[0].offsetHeight
if (thelength==0)
setTimeout("getdataheight()",10)
else
dataobj[1]=dataobj[0].cloneNode(true);
dataobj[1].style.top=thelength+5+'px';
document.body.appendChild(dataobj[1]);
scrollDiv()
}

function scrollDiv(){
for (var z0=0;z0<dataobj.length;z0++){
dataobj[z0].style.top=parseInt(dataobj[z0].style.top)-scrollspeed+"px"
if (parseInt(dataobj[z0].style.top)<thelength*(-1))
dataobj[z0].style.top=parseInt(dataobj[z0].style.top)+thelength*2+"px"
}
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>

vbjohn
01-06-2010, 11:00 PM
I am using this Script here. So that is why I am posting it here.

On some pages I get this message... "This program cannot display"

Then on others it works well.

Once I entered in basic code like this and it worked well.

Ok I am having issues with this. With this code it works...



<!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>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="css/style.css" />

</head>
<body>
<SCRIPT type="text/javascript" src="http://www.infusionmg.com/MinnstarNetworksOnlineAd/scroll.js"></SCRIPT>
</body>
</html>


On this it does not work. Can you help me out with this?



<!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>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script language="JavaScript">
function mdy(todaysdate) {
//calls the function mdy why to get our date
return todaysdate.getMonth()+1+"/"+todaysdate.getDate()+"/"+todaysdate.getYear()
}
</script>
</head>

<body>
<div id="wrapper">
<div id="container">
<div id="header">
<div id="logo"><span></span></div>
<div id="primary_menu">
<div id="pm_main">
<ul>
<li><A href="index.html"><b>Home</b></A></li>
<li><A href="advertise.html"><b>Advertising Services</b></A></li>
<li class="active"><A href="online.html"><b>Online Ad Program</b></A></li>
<li><A href="privacy.html"><b>Privacy Policy</b></A></li>
<li><A href="contact.html"><b>Contact</b></A></li>
</ul>
</div>
<div id="pm_sub">
<ul>
<li></li>
</ul>
</div>
</div>
</div>

<div id="conent">
<div class="left_col">
<div class="db1">
<div class="db1_title">
<h3>Online Program</h3>
</div>
<div class="db1_content">
<div class="db1_container">
<p>
<SCRIPT type="text/javascript" src="http://www.infusionmg.com/minnstarnetworksonlinead/scroll.js"></SCRIPT>
</p>
</div>
</div>
</div>
</div>


</div>
</div>
</div>

</body>
</html>

vbjohn
01-07-2010, 03:22 PM
Can anyone help with the one above? I need this by this afternoon. Thank you.

jscheuer1
01-07-2010, 03:31 PM
Can anyone help with the one above? I need this by this afternoon. Thank you.

This is a help forum, not a job site. Most of us don't respond to deadlines, at least not here.

Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

Did you try:

http://www.dynamicdrive.com/forums/showpost.php?p=213091&postcount=3?

In any case, if you want it as fast as we can do it, we might need a link to your page:

Please post a link to the page on your site that contains the problematic code so we can check it out.

If I had to guess though, I'd say that the path to external.htm needs to be absolute:


var iframesrc="http://www.infusionmg.com/MinnstarNetworksOnlineAd/external.htm"
document.write('<iframe id="datamain" src="'+iframesrc+'" width="300px" height="250px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"></iframe>')

vbjohn
01-07-2010, 04:19 PM
Thanks. I will put those things back up for the credit.