I am building a website. Now I want to put a couple of lines on my
page which I want to blink. <blink> is not supported for shapes/lines
and I want to decide myself if i want a line to blink. What do I mean:
button1.onclick{
line1.blink(??)}
button2.onclick{
line2.blink(??)}
button3.onclick{
stop blinking line1}
function blink(line){
blink every second (line.strokecolor = 'blue' and next time
line.strokecolor = 'red' for example)
}
Can it be done with setInterval or setTimeout? Mention that more than
one line has to blink.
Can anyone help me? Perhaps something with a timer or so. I am not
that experienced with java/programming. I realy appreciate your help. 8 2814
Hugo wrote: I am building a website. Now I want to put a couple of lines on my page which I want to blink. <blink> is not supported for shapes/lines and I want to decide myself if i want a line to blink.
HAS it NOT occurred TO you THAT your VISITORS might FIND blinking CONTENT
rather ANNOYING? you MIGHT be ABLE to DO this WITH animated GIF images, BUT
there IS nothing YOU can DO in CSS or HTML that WILL achieve THIS effect.
IF you WANT a PROFESSIONAL-looking SITE, then DON'T make THINGS blink. IT
looks REALLY stupid.
--
Philip Ronan ph***********@virgin.net
(Please remove the "z"s if replying by email)
Hugo wrote: I am building a website. Now I want to put a couple of lines on my page which I want to blink. <blink> is not supported for shapes/lines and I want to decide myself if i want a line to blink. What do I mean:
Don't tell me, you're doing a major in psychology and want to see if you
can give your users epileptic fits?
Please don't do this, it's silly.
Zif.
Hugo said: I am building a website. Now I want to put a couple of lines on my page which I want to blink. <blink> is not supported for shapes/lines and I want to decide myself if i want a line to blink. What do I mean:
button1.onclick{ line1.blink(??)}
button2.onclick{ line2.blink(??)}
button3.onclick{ stop blinking line1}
function blink(line){ blink every second (line.strokecolor = 'blue' and next time line.strokecolor = 'red' for example) }
Can it be done with setInterval or setTimeout? Mention that more than one line has to blink. Can anyone help me? Perhaps something with a timer or so. I am not that experienced with java/programming. I realy appreciate your help.
The following example stores the timer, colors, and state as
attributes of the span of text that's blinking, so they can
all blink independently. Note that it assumes that the client
browser supports getElementById and setting style.color:
<html>
<head>
<title>blink</title>
<script type="text/javascript">
function startBlink(id,onColor,offColor) {
var text=document.getElementById(id);
text.blinkColorOn=onColor;
text.blinkColorOff=offColor;
text.blinkState=false;
text.blinkTimer=setInterval("blink('"+id+"')",500) ;
}
function stopBlink(id,color) {
var text=document.getElementById(id);
clearInterval(text.blinkTimer);
text.style.color=color;
}
function blink(id){
var text=document.getElementById(id);
text.style.color=text.blinkState?text.blinkColorOn :text.blinkColorOff;
text.blinkState=!text.blinkState;
}
</script>
</head>
<body>
<p>
This is some sample text.<br>
<span id="b1">This line will start to blink if you click B1</span></br>
This line is just normal text.<br>
<span id="b2">This line will start to blink if you click B2</span></br>
</p>
<button onclick="startBlink('b1','red','blue')">B1</button><br>
<button onclick="startBlink('b2','black','white')">B2</button><br>
<button onclick="stopBlink('b1','black');stopBlink('b2','b lack')"stop all blinking</button>
</body>
</html>
Zifud said: Hugo wrote: I am building a website. Now I want to put a couple of lines on my page which I want to blink. <blink> is not supported for shapes/lines and I want to decide myself if i want a line to blink. What do I mean:
Don't tell me, you're doing a major in psychology and want to see if you can give your users epileptic fits?
Please don't do this, it's silly.
It's silly to make lines blink constantly.
There are reasonable applications for lines that blink
a few times and then stop. dj*******@hotmail.com (Hugo) wrote in message news:<4a**************************@posting.google. com>... I am building a website. Now I want to put a couple of lines on my page which I want to blink. <blink> is not supported for shapes/lines and I want to decide myself if i want a line to blink. What do I mean:
Can it be done with setInterval or setTimeout? Mention that more than one line has to blink. Can anyone help me? Perhaps something with a timer or so. I am not that experienced with java/programming. I realy appreciate your help.
Be careful with blinking. Blinking is a good way to scare people away
from your site.
You can use the style visibility attribute to hide things in the
window. By hiding and making the thing visible under the control of a
timer, you could simulate blinking.
Here is an example that uses style visibility.
<http://groups.google.com/groups?q=rccharles+visibility&hl=en&lr=&selm=c6bb7 5ff.0410011823.3e287eed%40posting.google.com&rnum= 1>
i know that it is really irritating to use blinking lines and it isn't
for my homepage. I don't even think about it to use it for visitors.
The site I am making is for a small factory with a little Programmable
Logic Control. The website contains all pipelines of the factory. when
an alarm occurs in a pipeline, the pipeline has to blink. So, don't
just scream that blinking is irritating, that is so easy. But okay,
there where also people who want to help me. I know it can be done by
the visibility element, but I don't know how to use ONE timer and ONE
function with MULTIPLE lines. I hope somebody can help me with this
problem.
Greetings
Hugovic
Hugo wrote:
[snip] there where also people who want to help me. I know it can be done by the visibility element, but I don't know how to use ONE timer and ONE function with MULTIPLE lines. I hope somebody can help me with this problem.
Greetings Hugovic
Ah, always good to explain your actual problem, it makes life easier
for those who would help.
Lee has provided a solution above, though if you click the button more
than once the "stop blinking" function doesn't work properly. If you
are controlling the blink/don't blink programmatically, that may not
bother you.
Is it what you want?
Fred.
Fred Oz said: Hugo wrote: [snip] there where also people who want to help me. I know it can be done by the visibility element, but I don't know how to use ONE timer and ONE function with MULTIPLE lines. I hope somebody can help me with this problem.
Greetings Hugovic
Ah, always good to explain your actual problem, it makes life easier for those who would help.
Lee has provided a solution above, though if you click the button more than once the "stop blinking" function doesn't work properly.
Yes. As soon as I posted it, I realized that the "stop blinking"
function should have some error checking to ensure that there is
an active timer to be cleared. I had to leave, and walked away
feeling sure that somebody would post the correction. I never
thought about it again until now.
function stopBlink(id,color) {
var text=document.getElementById(id);
if(text.blinkTimer){
clearInterval(text.blinkTimer);
text.style.color=color;
}
} This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Markus |
last post by:
Blinking control
Perhaps my question is not exactly an Access question, but may
somebody might
give me an answer.i have a very important control on my report, called
"Stockflow"
and in case...
|
by: Sharon |
last post by:
The ErrorProvider text is also blinking together with the icon.
It’s making the reading of the error description very uncomfortable.
Is there a way to prevent the text from blinking while the...
|
by: Sharon |
last post by:
The ErrorProvider text is also blinking together with the icon.
It’s making the reading of the error description very uncomfortable.
Is there a way to prevent the text from blinking while the...
|
by: Lam |
last post by:
Hi
I try to make the text showm in the asp:Label to have some dynamic effect
such as
blinking, scrolling. Does any one know how to do that?
Thank
|
by: Ling |
last post by:
Hi,
I guessed this is a weird question but it really bothers me.
I created a web page w/ asp.net, have a menu on the top and a listbox
right below it. When I try to navigate the menu, the...
|
by: tony wong |
last post by:
i wish to make the button blinking for 5 times at 1 second interval.
how come i cannot see the blinking effect?
is there any screen update function? Thanks.
******************************...
|
by: fbergroth |
last post by:
Hi, I'm quite new to C# allthough I've been programming in other
languages for quite a while.
I'd like to change the blinking cursor inside a TextBox, I guess I
must derive the class and...
|
by: michels287 |
last post by:
Right now I have a touchscreen with a virual keyboard.
I would like to create arrow keys. If the user messed up the inputted text, he can move the blinking cursor left one space at a time between...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |