PDA

View Full Version : Flashing Links script IE7 problem



crappiekiller
03-21-2008, 09:39 PM
1) Script Title:
Flashing Links script

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex5/flashlink.htm
3) Describe problem:

After working for months. This script has suddenly started not working in IE7.

Works fine in FF.

IE gives the following error

MS JScript runtime error: Object doesn't support this property or method.

It's failing on this line in the script.

var flashtype=document.getElementById? flashlinks[i].getAttribute("flashtype")*1 : flashlinks[i].flashtype*1

Anyone got any ideas where to start. I suspect some MS update is the cause of the breakage.

Nile
03-21-2008, 10:28 PM
Hmm... Weird. But this script would be really easy to make a much simpler version just with a settimeout. Ill let you know if I finish it. ;)

crappiekiller
03-22-2008, 12:10 PM
That would be fantastic. One more odd clue the scripts page works on my home computer in IE7. I'll verify whether the scripts homepage works on my work computer and let you know. My home computer is XP Home if it matters and the work machines are XP Pro or W2k3 servers.

Nile
03-23-2008, 03:49 PM
Here you are:

<html>
<head>
<title>Nile Good</title>
<script type="text/javascript">
var i=0;
function flash(divid,background,color,speed)
{
div=document.getElementById(divid);
bg="white"; //Here goes your background for your text when not blinking
cr="black"; //Here does your color for your text when not blinking
if(i%2==0)
{
div.style.background=background;
div.style.color=color;
}else{
div.style.background=bg;
div.style.color=cr;
}
if(i>1)
{
i++;
}else{
i--;
}
setTimeout("flash('"+divid+"','"+background+"','"+color+"')",speed);
}
</script>
</head>

<body onload="flash('my','#F2F200','#5700EF','10');flash('new','#ef5678','#876789','500');flash('new2','#ED0000 ','#ffffff','1000');">

<div id="my">This text should flash blue with a yellow background at the reate of 10 milliseconds</div>
<div id="new">This text should flash black with a red background at the rate of 500 milliseconds.</div>
<div id="new2">This text should flash white with a red background at the rate of 1000 milliseconds</div>
</body>
</html>

crappiekiller
09-03-2008, 06:56 PM
The only problem with the new script is that I'm building my page on the fly with data and I can't predict how many rows in my table will require the flashing link (which are all the same flash type). The other script worked really well until it broke in IE7.