Results 1 to 7 of 7

Thread: Flashing link

  1. #1
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Flashing link

    I am trying to use your example on how to include a flashing link in my site and I am having no luck this far. I copied the script in the <HEAD> section of my code then added the following:

    <a href="insyde.html" id="flashlink0" flashtype=1 flashcolor="green">Click here</a>

    Since I am trying to have only 1 link in the page to flash, I did set my ID as 0 but it does not work. Am I missing something else? Any help provided regarding this matter will greatly be appreciated.
    Thanks!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That looks about right. However, the script is outdated and you either are using Opera, have installed it wrong, have styled your link in some way that conflicts or, something else is messing it up. A link to your problem page would help me figure out the trouble.

    In the meantime, here is a working demo with updated code and your link:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <div>
    <a href="insyde.html" id="flashlink0" rev=1 rel="lime">Click here</a>
    </div>
    <script type="text/javascript">
    
    /***********************************************
    * Flashing Link Script- &#169; Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    (function(){
    if(!document.getElementById&&!document.all)
    return;
    var changelinkcolor=function(el){
    el.it=el.it? el.it : init.it+=250;
    var el=el, rev=el.rev*1? 'backgroundColor' : 'color';
    if (el.on)
    el.style[rev]=el.rel;
    else
    el.style[rev]='';
    el.on=!el.on;
    setTimeout(function() {changelinkcolor(el);}, 1000+el.it)
    }
    
    var init=function(){
    var i=0; init.it=0;
    while(document.all&&document.all['flashlink'+i]!=null)
    changelinkcolor(document.all['flashlink'+i++]);
    if (!document.all){
    while (document.getElementById('flashlink'+i)!=null)
    changelinkcolor(document.getElementById('flashlink'+i++));
    }
    }
    init();
    })();
    </script>
    </body>
    </html>
    Last edited by jscheuer1; 04-18-2007 at 01:22 AM. Reason: Condense & Improve Code
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for the follow up John. I have not yet had the opportunity to implement the suggestion you have made. I am enclosing the link for the page which is giving me problems. Thanks again for your help.
    Fred

    http://www.lesmeeksauctions.com/pages/home.html

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The main reason that your link isn't flashing on the page you provided a link to in your post is that there is no script or markup on the page that would make it do so. I thought you said you had put the script on there and used the demo markup.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John,
    I apologize for the confusion as I was working on the page from the link I have sent you and inadvertently deleted the script. I have added the script back in but the problem persists. Please advise as to how this can be resolved.
    Thanks,
    Fred

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    No equals sign here (red):

    Code:
    <a href="insyde.html" id="flashlink=0" rev=1 rel="Lime">Click here</a> to vis
    Do it like:

    Code:
    <a href="insyde.html" id="flashlink0" rev=1 rel="Lime">Click here</a> to vis
    The script goes right before the closing </body> tag:

    Code:
    </table>
    
    </font>
    </center>
    <script type="text/javascript">
    
    /***********************************************
    * Flashing Link Script-  Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    (function(){
    if(!document.getElementById&&!document.all)
    return;
    var changelinkcolor=function(el){
    el.it=el.it? el.it : init.it+=250;
    var el=el, rev=el.rev*1? 'backgroundColor' : 'color';
    if (el.on)
    el.style[rev]=el.rel;
    else
    el.style[rev]='';
    el.on=!el.on;
    setTimeout(function() {changelinkcolor(el);}, 1000+el.it)
    }
    
    var init=function(){
    var i=0; init.it=0;
    while(document.all&&document.all['flashlink'+i]!=null)
    changelinkcolor(document.all['flashlink'+i++]);
    if (!document.all){
    while (document.getElementById('flashlink'+i)!=null)
    changelinkcolor(document.getElementById('flashlink'+i++));
    }
    }
    init();
    })();
    </script>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That did it! Thanks for your help John!
    Fred

Bookmarks

Posting Permissions

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