TinyPortal

Development => Support => Topic started by: thefley on March 25, 2008, 02:34:03 AM

Title: How do I get this to AUTO scroll?
Post by: thefley on March 25, 2008, 02:34:03 AM
<script language="JavaScript" src="http://itde.vccs.edu/rss2js/feed2js.php?src=http%3A%2F%2Fsameerkumar.blogspot.com%2Ffeeds%2Fposts%2Fdefault%3Falt%3Drss&chan=y&num=0&desc=0&date=y&targ=y" type="text/javascript"></script>

<noscript>
View RSS feed (http://itde.vccs.edu/rss2js/feed2js.php?src=http%3A%2F%2Fsameerkumar.blogspot.com%2Ffeeds%2Fposts%2Fdefault%3Falt%3Drss&chan=y&num=0&desc=0&date=y&targ=y&html=y)
</noscript>



BUT how do I get this to auto scroll? I would like to add it to and article box or I can cut out the dates and time stamp to make smaller for side box...

Thx.
Title: Re: How do I get this to AUTO scroll?
Post by: JPDeni on March 25, 2008, 12:50:30 PM


<div style="width:100%; height:150px; overflow: auto">

...

</div>



Play around with the height and width until it's what you like.
Title: Re: How do I get this to AUTO scroll?
Post by: thefley on March 25, 2008, 08:23:29 PM
I can't seem to get it to auto scroll.  it just gives me a scrol bar....  what am I doing wrong?
Title: Re: How do I get this to AUTO scroll?
Post by: IchBin on March 25, 2008, 08:36:02 PM
To auto scroll you'll have to use a <marquee> tag.
http://www.htmlcodetutorial.com/_MARQUEE.html
Title: Re: How do I get this to AUTO scroll?
Post by: thefley on March 26, 2008, 12:35:18 AM
thx again, but I guess I didn't ask right again....  I would like the RSS feeds I have to keep scrolling up as I would like to keep the box hight small.  I seen somewere in some threads that when you mouse over it stops but I can not find it again.
Title: Re: How do I get this to AUTO scroll?
Post by: JPDeni on March 26, 2008, 12:49:23 AM
I misunderstood what you wanted.

Here's the gist of it:


echo '
<style type="text/css">

#marqueecontainer{
position: relative;
width: 95%; /*marquee width */
height: 150px; /*marquee height */
overflow: hidden;
padding: 2px;
padding-left: 4px;
}

</style>

<script language="javascript" type="text/javascript">

/***********************************************
* Cross browser Marquee II- © 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=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1
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")
if(cross_marquee == null)
   return
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>

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

//***** Enter your text here ****//

echo '
</div>
</div>
   ';


Whatever you put into the area that says

//***** Enter your text here ****//

will scroll in the block.

I don't know how to get the rss text, though, so that's up to you.
Title: Re: How do I get this to AUTO scroll?
Post by: thefley on March 27, 2008, 10:28:36 PM
THx your the best!!!