A peculiar web-coding conundrum
Post Reply
Quote
Re: A peculiar web-coding conundrum
Posted by Gollum on Wed Nov 16th at 1:08pm 2005


Whilst designing a web site, I came across this bizarre puzzle. I've created a minimal test case that demonstrates the bug in as simple a framework as possible. There are four short test pages:

http://www.snarkpit.net/pits/gollum/javascript-test/test1/test1.html

The bug appears in Firefox, but not in IE.

See what you think. The input of web developers and coders would be especially helpful (Crono?).

It seems that I need some way to take the focus away from a link, after the link is clicked. Any ideas?




Quote
Re: A peculiar web-coding conundrum
Posted by Gollum on Wed Nov 16th at 2:57pm 2005


Hmmm, I seem to have solved my own puzzle. I can move the focus away from the link and to some other element with this script:

document.getElementById('some other element').focus()

Other comments and ideas still welcome though Sorry if I wasted anyone's time.




Quote
Re: A peculiar web-coding conundrum
Posted by Crono on Wed Nov 16th at 6:40pm 2005


Focus is very useful.

I usually use it for popups. (well, mixed with the parent definition)

I didn't see what the original problem was. Or what you were going for.



Blame it on Microsoft, God does.



Quote
Re: A peculiar web-coding conundrum
Posted by Gollum on Wed Nov 16th at 9:33pm 2005


? quote:
Focus is very useful.

I usually use it for popups. (well, mixed with the parent definition)

I didn't see what the original problem was. Or what you were going for.


I've never explicitly used focus in web pages before, so at first it didn't occur to me.

The original problem (see test 3 on that link) was this: when you click a link, Firefox won't scroll the page (with arrow keys, page Down/Up, or mousewheel) until you refocus the document by clicking somewhere else. It would be very confusing to many people, who might think the page was broken.

I was going for the ability to hide parts of a page by clicking on a link within that part. So when you click the link, it disappears.

It might not seem very useful, but it would be great for showing/hiding navbars, or even showing a fullscreen view (which is what I have in mind).




Quote
Re: A peculiar web-coding conundrum
Posted by Crono on Thu Nov 17th at 12:04am 2005


Oh.

Yeah, IE let's the scroll bars act where the mouse sits ... I think. Not sure, I haven't actually loaded IE in a long time.

Cool.



Blame it on Microsoft, God does.




Post Reply