Script Categories













Messages >>> Smart Marquee.

Changes the speed and direction of the marquee message based on mouse movement.

Add this JavaScript to your site!

(Move your mouse from one side to the other to control scrolling direction and speed.)

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">      
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var ostat = false;
function scrollstop() {
news.scrollAmount = 0;
ostat = true;
}
function scrollplay() {
news.scrollAmount = 5;
ostat = false;
}
function scrolldir() {
mid = document.body.clientWidth / 2;
//mouse = event.x;
if(mouse > mid) {
if(ostat == false) {
speed = (mouse - mid) / 25;
news.scrollAmount = speed;
}
news.direction = "right";
}
else {
if(ostat == false) {
speed = (mid - mouse) / 25;
news.scrollAmount = speed;
}
news.direction = "left";
   }
}

if (!document.all) {
window.captureEvents(Event.MOUSEMOVE);
function nsmouse(evnt) {
mouse = evnt.pageX;
scrolldir()
}
window.onmousemove = nsmouse;
}
else  {
function iemouse() {
mouse = event.x;
scrolldir()
}
window.document.onmousemove = iemouse;
}
//  End -->
</script>
<center>
<
marquee name=news id=news behavior=scroll direction=left scrollamount=5 scrolldelay=1 hspace=0 vspace=0 onmouseover="scrollstop()" onmouseout="scrollplay()">
<
b>Add this JavaScript to your site!</b>
<
/marquee>
<
br><br>

(Move your mouse from one side to the other to control scrolling direction and speed.)
</center>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).




©