PDA

View Full Version : :: problems with a script ::


babelfish
05-16-2003, 03:49 PM
hi peeps! :D

http://www.simonsgroup.com/IT/DEVELOPMENT/WEBSITE.nsf/content/people_index

on that page i have added some basic rollovers to the content in the middle, basically i made a rollover script when you mouseover the 4 links in the middle of the page but as you will see it flashes a lot whiklst moving the mouse

i have added a setTimeout but it doesnt seem to help! any ideas?

<script language ="javascript" type="text/javascript">
function tableOut(what) {
setTimeout (what.background='http://www.simonsgroup.com/webimg/navimg/spacer.gif', 30000 ); ;
}

function tableOver(what) {
setTimeout (what.background='http://www.simonsgroup.com/webimg/navimg/table_rollout.gif', 30000 );
}
</script>

thx all!!!!!!

MrDoubtFire
05-16-2003, 04:51 PM
Just a thought and I haven't tested it, but shouldn't you be adding a "return false;" in those functions?

MrDoubtFire

Roy Sinclair
05-16-2003, 04:51 PM
When I rollover the images in the middle of the page I get a series of Javascript errors displayed. Turn on the reporting of javascript errors in your browser and then go fix those errors. Then see if the "flashing" problem still exists.

babelfish
05-16-2003, 04:56 PM
thats cos i screwed up the setTimeout thingy... (js errors) it still flashes without it!

i added return false; and it didnt make any difference :(

Roy Sinclair
05-16-2003, 05:06 PM
I don't see any flashing now. IE6 on W2K it seems to be working just fine.

RoyW
05-16-2003, 06:39 PM
There is some slight flickering.
First I added

if(status.length > 200)
status='';
status += 'Out';

and

if(status.length > 200)
status='';
status += 'Over';

To your table over and table out code. That showed that over and out events were ocurring as you moved over the Cell, the text and the image.

I then added

alert(event.srcElement.tagName);

to the functions and saw that your tableOver and tableOut functions were being called for the mouse over and out for
IMG, H4, and TD.

It looks to me like it is something to do with event bubbling.

Maybe someone who is an expert at events and event bubbling can help you with this one.

<edit>
I added

if(status.length > 200)
status='';
status += 'Ovr-'+event.srcElement.tagName+":";


and

if(status.length > 200)
status='';
status += 'Out-'+event.srcElement.tagName+":";



And the status line reads
Ovr-TD:Out-TD:Ovr-H4:Out-H4:Ovr-TD:Out-TD:Ovr:IMG

As you move from outside the table, over the text then over the image.
</edit>

babelfish
05-19-2003, 12:27 PM
yeah... i did notice that the effect occured when moving over text - still not working fully tho although i will cope with it for time being unless anyone has any ideas

Roy Sinclair
05-19-2003, 08:49 PM
I still don't see any flickering, this may be due more to a difference in the video subsystem and/or drivers than a problem on the web page itself.


Everything is rock steady with a Matrox G400 video subsystem under W2K (I need to remember to try this at home on my Radeon 9700 Pro).

babelfish
05-20-2003, 09:00 AM
what IE are you using?

im using IE 5.01 here on matrox g400 and win2k sp 3 :D its the fact that when you mouseover the text it suddenly doesnt think its over the TD and flashes

Roy Sinclair
05-21-2003, 01:30 AM
IE 6 SP1 at work. Here at home it's also IE 6 SP1 but under XP and I here see the flashing of the highlight area as the mouse moves around.