Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14

Thread: Blinking Links

  1. #1
    New to the CF scene
    Join Date
    Jul 2004
    Location
    U.K.
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Blinking Links

    Hi everyone,

    This is my first posting and it is a cry for help.

    Can anyone let me have a script that will blink a link to another web site and stop blinking permanently when clicked on.

    I know the way to get it blinking (<blink> </blink>) but I cannot get it to stop once the link has been used.

    Any help would be greatly appreciated.

    Sincerely,

    Robert Shields
    http://www.The-Robert-Shields-College.co.uk

  • #2
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Is this link opening a page in a new window and you just want it not to blink for the existing session? Or are you looking to have it not blink any time they return to the page afer the link is clicked?

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #3
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Isn't <blink> ie only?

    anyway, I think this would work:

    Code:
    <html>
    <head>
    <script>
    
    var color = true
    
    var int = setInterval('blink()',500)
    
    function blink() {
    if(color==true) {
    document.getElementById('link').style.color = "#0f0"
    color= false
    }
    else  {
    document.getElementById('link').style.color = "#00f"
    color=true
    }
    }
    
    
    function stopBlink() {
    clearInterval(int)
    }
    </script>
    </script>
    <body>
    <a href="#" id="link" onclick="stopBlink()">text</a>
    </html>
    Last edited by JPM; 07-18-2004 at 08:30 PM.
    <JPM />

  • #4
    Regular Coder
    Join Date
    Jul 2004
    Location
    engoku no anime
    Posts
    354
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <blink> isn't IE only, but rather Netscape (and any Mozilla versions based on Netscape) only. It shouldn't blink in IE unless you used a script to create a blinking effect.

  • #5
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by gohankid77
    <blink> isn't IE only, but rather Netscape (and any Mozilla versions based on Netscape) only. It shouldn't blink in IE unless you used a script to create a blinking effect.
    i thot <blink> was NS4.x or lesser only. thot it had been deprecated under NS6+?

  • #6
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I checked it and it works in NS6+? (no reason to use it ofcourse)
    <JPM />

  • #7
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts

  • #8
    New to the CF scene
    Join Date
    Jul 2004
    Location
    U.K.
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi everyone,

    I'm gobsmacked at the help offered as to be honest, I thought I would probably not see a reply and if there was one it would be some weeks before it was posted. This forum really is Ace.

    Thank you very much everyone, I really do appreciate your help.

    JPM/Basscyst: I tried and tested your script JPM and it worked fine in that it linked to another page, but when I reloaded the original 'blinking' page is was still blinking. I was hoping to have it not blink any time they return to the page afer the link is clicked.

    Again, my sincere thanks for your help.

  • #9
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So if someone clicked the blinking link a week ago and returns to your page you dont want it to blink?
    <JPM />

  • #10
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you'd have to set a cookie to remember that state.

    of course, the cookie could get cleared, in which case the user would be back to seeing your blinking webpage again.

    however, it's cookies that you want to explore.

  • #11
    New to the CF scene
    Join Date
    Jul 2004
    Location
    U.K.
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's right JPM.

    I also see the problem if cookies are cleared jbot but that would not be problem as I would be placing new links on the blinking link on a regular basis.

    I really do appreciate you guys helping.

  • #12
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm... not sure if I should be posting this...guess it would be doing everything you asked before giving you some hints, but :



    Code:
    <html>
    <head>
    <script>
    
    var color = true
    
    var int = setInterval('blink()',500)
    
    function blink() {
    if(color==true) {
    document.getElementById('link').style.color = "#0f0"
    color= false
    }
    else  {
    document.getElementById('link').style.color = "#00f"
    color=true
    }
    }
    
    
    function stopBlink() {
    clearInterval(int)
    }
    
    
    //////////// cookie script from echoecho.com  ////////////
    
    function getCookie(NameOfCookie){
        if (document.cookie.length > 0) {              
        begin = document.cookie.indexOf(NameOfCookie+"=");       
        if (begin != -1) {           
          begin += NameOfCookie.length+1;       
          end = document.cookie.indexOf(";", begin);
          if (end == -1) end = document.cookie.length;
            return unescape(document.cookie.substring(begin, end));
        } 
      }
      return null;
    }
    
    function setCookie(NameOfCookie, value, expiredays) {
    var ExpireDate = new Date ();
    ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
    
      document.cookie = NameOfCookie + "=" + escape(value) + 
      ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
    }
    
    
    
    function DoTheCookieStuff()
    {
    var blink = getCookie('blink');
    if (blink!=null) { stopBlink() }
    else { alert("TEST") }
    }
    
    
    
    
    </script>
    </script>
    <body onload="DoTheCookieStuff()">
    <a href="#" id="link" onclick="stopBlink();setCookie('blink','stop',365)">text</a>
    </html>

    ('blink','stop',365), 365 = days before cookie expires
    <JPM />

  • #13
    New to the CF scene
    Join Date
    Jul 2004
    Location
    U.K.
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    JPM, many, many thanks. That works perfectly.

    Is there anywhere you know where I can contribute a few bucks to show my appreciation, preferably through PayPal?

    I always feel kindness should be rewarded in some way.

    Again, my thanks.

    Robert

  • #14
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just glad to help out, no need for money or anything.Also most of the cookie script was taken from here
    Last edited by JPM; 07-19-2004 at 05:55 PM.
    <JPM />


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •