Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[tut] Make a news scroller without Javascript
#7
Ok, here is the javascript that will make it stop and go on mouse over, it's super simple, just put this in your HTML head:
Code:
<script type="text/javascript">
function scrollover(){
document.getElementById('scroll2').scrollAmount = 0;
return false;
}
function scrollout(){
document.getElementById('scroll2').scrollAmount = 3;
return false;
}
</script>

And add this to the scroller div:
Code:
onMouseOver="scrollover()" onMouseOut="scrollout()"

So the complete code to put where you want the scroller would be:
Code:
<div id="scroller" height="300px" width="200px" onMouseOver="scrollover()" onMouseOut="scrollout()">
<marquee ID="scroll2" scrollamount="3" direction="up" height="350">
<!--Put the stuff that you want to scroll between here-->
Item 1
<p />
Item 2
<p />
Item 3
<p />
<!--and here-->
</marquee>
</div>
MyBB Support team member.
[Image: smallsig.png]
Reply


Messages In This Thread
RE: [tut] Make a news scroller without Javascript - by Tim - 12-10-2009, 04:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [tut] I Want to Make a Website, but, I don't know What to Do Grizzly 2 1,652 04-16-2014, 08:51 AM
Last Post: cracker007
  Free Worker HTML, CSS, Javascript ImFocuzz 2 1,288 04-05-2014, 10:01 PM
Last Post: VHPanda
  [MyBBError Message] PLEASE HELP ME!! Enable Javascript Registration Error iRun 4 1,943 01-26-2012, 03:13 PM
Last Post: iRun
  Close Tab With Javascript. Qua 3 1,423 07-02-2011, 07:25 AM
Last Post: djakariuz
  [TUT]Learn to edit and make pics in HTML. SVG coding language. Easy to learn! [TUT] Qua 2 1,457 06-24-2011, 09:42 PM
Last Post: Qua

Forum Jump:


Users browsing this thread: 1 Guest(s)