Forum Moderators: open
No, I've not lost my mind, I really do want to know how to make some text blink but only for a few seconds to draw a users attention to somthing.
It's for a 'my favorites' type thingy, when the bookmark a page of the site, they will have a link to 'view their favorites' and the as the link is not normally part of the page navigation I'd like to draw attention to it.
Do I have to use JS to achieve this? - I know of the text-decoration: blink jobbie but is there a way to control the amount of time it blinks that I'm not aware of?
Opinions on whether this is valuable would also be welcome though I'll probably do it anyway ;)
Many thanks..
Nick
Interestingly enough, I found a use for marquee in a web app. Its a web-controlled MP3 player that scrolls the title so the app can fit in a popup of specific width. (Yes that's two 'web sins'.)
<script type="text/javascript">
function init() {
setTimeout("stopBlink", 5000); // 5 seconds
}function stopBlink() {
document.getElementById("blink").style.textDecoration = "none";
}
</script><a id="blink" style="text-decoration:blink" href="favorites.html">My Favorites</a>
But it does not work! It blinks eternally, mocking me! (I never did look too deeply into this JS+CSS stuff.)
<script type="text/javascript" language="JavaScript">
<!--
function blink(){
blink_x = 1
blink_y = 1
ticToc();
}function ticToc(){
if(blink_x==1){
blink_x=0;
blink_y++;
document.getElementById("blink").style.visibility='visible';
}else {
blink_x=1;
blink_y++;
document.getElementById("blink").style.visibility='hidden';
}
if (blink_y < 20) {setTimeout('ticToc()', 100);}
}
-->
</script>
Manipulate the values 20 and 100 in the bottom line until they suit you. I assume the thingy that must blink has an ID="blink". Call the script by:
<body onLoad="blink();">
/claus
<added>
-valuable? Yes, with the time limit. At least i found it valuable enough to write it. It's for my company page that has two languages. The default language is English, but as i live in Denmark, my Danish visitors need to be made aware of the version in Danish.
</added>
I've got it running very smoothly, thanks.
What I'm now doing is this:
Very neat. Thanks again!
Nick
Nah.... it only blinks twice after a very specific action to alert you to the fact that you have 'bookmarks'. It's rather useful actually but I'll update this thread when it goes live and I get complaints ;)
>animated gif
Never even crossed my mind. Doh!
An elegant solution but I like the text version better ;-)
Nick
Tools like blinking text, scrolling marquees, popup windows - all considered evil - can be very helpful, even the only right tool, depending on the situation.
And, it's not like it blinks forever, just flashes two times to tell the visitor that he has a new link. Very clever, Nick!
Nick
7.2 Until user agents allow users to control blinking, avoid causing content to blink (i.e., change presentation at a regular rate, such as turning on and off). [Priority 2]