PDA

View Full Version : Flashing link



SemperFiFred
04-17-2007, 10:15 PM
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!

jscheuer1
04-17-2007, 11:13 PM
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:


<!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>

SemperFiFred
04-18-2007, 09:03 PM
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

jscheuer1
04-19-2007, 02:35 PM
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.

SemperFiFred
04-25-2007, 06:18 PM
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

jscheuer1
04-26-2007, 06:18 AM
No equals sign here (red):


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

Do it like:


<a href="insyde.html" id="flashlink0" rev=1 rel="Lime">Click here</a> to vis

The script goes right before the closing </body> tag:


</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>

SemperFiFred
04-26-2007, 02:31 PM
That did it! Thanks for your help John!
Fred