469,290 Members | 1,868 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

How to set focus to a div?

Hi,

Under Firefox, you can't scroll using the keyboard on this links page
unless you click on the div first:

http://numbrosia.com/?cmd=links

Is there a way to automatically set focus to a div?

Amir
Feb 28 '08 #1
8 19126
Amir Michail wrote:
Under Firefox, you can't scroll using the keyboard on this links page
unless you click on the div first:

http://numbrosia.com/?cmd=links
Eww.

Why - if I scroll to the right (a no-no itself) do I find an extra
scrollbar lodged inside my own vertical scrollbar?

Why: "Please enable JavaScript." So I can see your Google ads?
(obtrusive ads are one big reason a lot of people surf with JavaScript
disabled)
Is there a way to automatically set focus to a div?
<div id="somename"... content ... </div>

and with a link of: http://example.com/mypage.html#somename

--
-bts
-Motorcycles defy gravity; cars just suck
Feb 28 '08 #2
On Feb 28, 2:21 pm, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
Amir Michail wrote:
Under Firefox, you can't scroll using the keyboard on this links page
unless you click on the div first:
http://numbrosia.com/?cmd=links

Eww.

Why - if I scroll to the right (a no-no itself) do I find an extra
scrollbar lodged inside my own vertical scrollbar?
This is not a problem under Firefox. I don't know how to fix this
under IE7.
>
Why: "Please enable JavaScript." So I can see your Google ads?
(obtrusive ads are one big reason a lot of people surf with JavaScript
disabled)
Is there a way to automatically set focus to a div?

<div id="somename"... content ... </div>

and with a link of: http://example.com/mypage.html#somename
Yes, that works, thanks.

Amir

--
-bts
-Motorcycles defy gravity; cars just suck
Feb 28 '08 #3
Amir Michail wrote:
"Beauregard T. Shagnasty" wrote:
>Amir Michail wrote:
>>Under Firefox, you can't scroll using the keyboard on this links
page unless you click on the div first:
>>http://numbrosia.com/?cmd=links

Eww.

Why - if I scroll to the right (a no-no itself) do I find an extra
scrollbar lodged inside my own vertical scrollbar?

This is not a problem under Firefox. I don't know how to fix this
under IE7.
Remove the overflow:auto; ?

I would use the blue sun as a body background image, set to no-repeat,
and just place that long menu in the content. Seems simple enough.

This would also greatly reduce the scrolling lag .. to 'none'.

Your page is not scrollable at all in Opera.

--
-bts
-Friends don't let friends drive Vista
Feb 28 '08 #4
Beauregard T. Shagnasty replied to hisself:
I would use the blue sun as a body background image, set to no-repeat,
and just place that long menu in the content. Seems simple enough.

This would also greatly reduce the scrolling lag .. to 'none'.
Oh wait. The blue sun image is actual size of 1024x576 but you have
1037x628 in your code. So every time someone scrolls, the image is
trying to resize itself. Change either the code to the image size, or
resize the image to what you want on the page. Exactly.

--
-bts
-Friends don't let friends drive Vista
Feb 28 '08 #5
On Feb 28, 3:05 pm, "Beauregard T. Shagnasty"
<a.nony.m...@example.invalidwrote:
Beauregard T. Shagnasty replied to hisself:
I would use the blue sun as a body background image, set to no-repeat,
and just place that long menu in the content. Seems simple enough.
This would also greatly reduce the scrolling lag .. to 'none'.

Oh wait. The blue sun image is actual size of 1024x576 but you have
1037x628 in your code. So every time someone scrolls, the image is
trying to resize itself. Change either the code to the image size, or
resize the image to what you want on the page. Exactly.
I wanted to resize the image to the current window size. So I used a
hack I found on the web to do that.

Amir
--
-bts
-Friends don't let friends drive Vista
Feb 28 '08 #6
Amir Michail wrote:
>
I wanted to resize the image to the current window size. So I used a
hack I found on the web to do that.
Just because you can, doesn't mean you should.

--
Berg
Feb 28 '08 #7
On Feb 28, 4:36 pm, Bergamot <berga...@visi.comwrote:
Amir Michail wrote:
I wanted to resize the image to the current window size. So I used a
hack I found on the web to do that.

Just because you can, doesn't mean you should.
Why not? One would expect a non-repeating puzzle/game background to
scale to the window size.

Amir
--
Berg
Feb 28 '08 #8
..oO(Amir Michail)
>On Feb 28, 4:36 pm, Bergamot <berga...@visi.comwrote:
>Amir Michail wrote:
I wanted to resize the image to the current window size. So I used a
hack I found on the web to do that.

Just because you can, doesn't mean you should.

Why not? One would expect a non-repeating puzzle/game background to
scale to the window size.
Not really. Or maybe it's just me who finds such distorted images ugly?
At first it wasn't even clear to me what this blue egg was supposed to
be (my browser viewport is almost a square at the moment) ...

Micha
Feb 28 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Nitin | last post: by
3 posts views Thread by VA | last post: by
17 posts views Thread by Neil Ginsberg | last post: by
1 post views Thread by avnrao | last post: by
11 posts views Thread by Alex.Svetos | last post: by
7 posts views Thread by Dave Booker | last post: by
3 posts views Thread by jp2express | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.