View Full Version : Onmouseover for MARQUEE ???
Anayet
December 11th, 2001, 00:08
Is it possible to use somekind of Onmouseover command in a marquee, so that when the mouse is put over it, it will stop?
Thanks
meow
December 11th, 2001, 01:27
Only if you skip the marquee and make it a real animation.
Anayet
December 11th, 2001, 01:48
How do you go about doing it that way?:confused2 :confused:
meow
December 11th, 2001, 02:44
You make an animated GIF with scrolling text and swap it for a normal GIF with static text with JavaScript.
But if you're set on your MARQUEE, OK, I ought to be spanked for this (Weeps! Bring the stick!) and they surely will kick me out of the w3c now but here ya go. :confused2
------------------------------
IN HEAD:
<style type="text/css">
<!--
marquee { visibility: visible; cursor: pointer; cursor: hand }
-->
</style>
<script type="text/javascript" language="javascript">
<!--
function StopIt()
{
if (!document.styleSheets) return;
var newstl = new Array();
if (document.styleSheets[0].cssRules)
newstl = document.styleSheets[0].cssRules;
else if (document.styleSheets[0].rules)
newstl = document.styleSheets[0].rules;
else return;
newstl[0].style.visibility = 'hidden';
}
//-->
</script>
IN BODY:
<marquee onclick="StopIt()">
Proprietary coding is bad for you!</marquee>
------------------------------
:o :o :o :o :o
Anayet
December 11th, 2001, 03:22
I may be doing something wrong, but does that not just hide the marquee :biggrin2:
And that gif method, are you talking about mouseovers that just change the image, or is this something else that uses javascript?
thanks
meow
December 11th, 2001, 03:43
Boy, you are picky! :devious2: :p
------------------
IN HEAD:
<style type="text/css">
<!--
marquee { visibility: visible; cursor: pointer; cursor: hand }
#marq { visibility: hidden }
marquee,#marq { position: absolute; top: 0; left 0 }
-->
</style>
<script type="text/javascript" language="javascript">
<!--
function StopIt()
{
if (!document.styleSheets) return;
var newstl = new Array();
if (document.styleSheets[0].cssRules)
newstl = document.styleSheets[0].cssRules;
else if (document.styleSheets[0].rules)
newstl = document.styleSheets[0].rules;
else return;
newstl[0].style.visibility = 'hidden';
newstl[1].style.visibility = 'visible';
}
//-->
</script>
IN BODY:
<marquee onclick="StopIt()">
Proprietary coding is bad for you!</marquee>
<p id="marq">
This is much better than a sucky marquee.</p>
------------------
The positioning will suck, but I don't know how you have it on your page. At least you can see if it works.
And yes, I meant a mouseover that uses JavaScript. :biggrin2:
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.