blinking lines

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hugo

    blinking lines

    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.strokecol or = 'blue' and next time
    line.strokecolo r = '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.
  • Philip Ronan

    #2
    Re: blinking lines

    Hugo wrote:
    [color=blue]
    > 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.[/color]

    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
    phil.ronanzzz@v irgin.net
    (Please remove the "z"s if replying by email)


    Comment

    • Zifud

      #3
      Re: blinking lines

      Hugo wrote:[color=blue]
      > 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:[/color]

      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.

      Comment

      • Lee

        #4
        Re: blinking lines

        Hugo said:[color=blue]
        >
        >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.onclic k{
        >line1.blink(?? )}
        >
        >button2.onclic k{
        >line2.blink(?? )}
        >
        >button3.onclic k{
        >stop blinking line1}
        >
        >function blink(line){
        >blink every second (line.strokecol or = 'blue' and next time
        >line.strokecol or = '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.[/color]


        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,o nColor,offColor ) {
        var text=document.g etElementById(i d);
        text.blinkColor On=onColor;
        text.blinkColor Off=offColor;
        text.blinkState =false;
        text.blinkTimer =setInterval("b link('"+id+"')" ,500);
        }
        function stopBlink(id,co lor) {
        var text=document.g etElementById(i d);
        clearInterval(t ext.blinkTimer) ;
        text.style.colo r=color;
        }
        function blink(id){
        var text=document.g etElementById(i d);
        text.style.colo r=text.blinkSta te?text.blinkCo lorOn:text.blin kColorOff;
        text.blinkState =!text.blinkSta te;
        }
        </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="startB link('b1','red' ,'blue')">B1</button><br>
        <button onclick="startB link('b2','blac k','white')">B2 </button><br>
        <button onclick="stopBl ink('b1','black ');stopBlink('b 2','black')"[color=blue]
        >stop all blinking</button>[/color]
        </body>
        </html>

        Comment

        • Lee

          #5
          Re: blinking lines

          Zifud said:[color=blue]
          >
          >Hugo wrote:[color=green]
          >> 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:[/color]
          >
          >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.[/color]

          It's silly to make lines blink constantly.
          There are reasonable applications for lines that blink
          a few times and then stop.

          Comment

          • Robert

            #6
            Re: blinking lines

            djhugovic@hotma il.com (Hugo) wrote in message news:<4a827a4c. 0410180348.7535 37dd@posting.go ogle.com>...[color=blue]
            > 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:
            >[/color]
            [color=blue]
            > 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.[/color]

            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.c om/groups?q=rcchar les+visibility& hl=en&lr=&selm= c6bb75ff.041001 1823.3e287eed%4 0posting.google .com&rnum=1>

            Comment

            • Hugo

              #7
              Re: blinking lines

              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

              Comment

              • Fred Oz

                #8
                Re: blinking lines

                Hugo wrote:
                [snip][color=blue]
                > 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[/color]

                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 programmaticall y, that may not
                bother you.

                Is it what you want?

                Fred.

                Comment

                • Lee

                  #9
                  Re: blinking lines

                  Fred Oz said:[color=blue]
                  >
                  >Hugo wrote:
                  >[snip][color=green]
                  >> 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[/color]
                  >
                  > 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.[/color]

                  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,co lor) {
                  var text=document.g etElementById(i d);
                  if(text.blinkTi mer){
                  clearInterval(t ext.blinkTimer) ;
                  text.style.colo r=color;
                  }
                  }

                  Comment

                  Working...