473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 19435
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nitin | last post by:
Hi I have created function to check date and time. at the time of execution, if date is left empty the function returns the error message but then the focus goes to next field. Next filed is for...
2
by: Peter Wright | last post by:
Hi all. Hopefully this should demonstrate the problem I'm having: http://flooble.net/~pete/focus-problem-demo/ (I'm testing it in Mozilla only, but I'm not sure if it's actually a...
3
by: VA | last post by:
t=document.getElementById('mytable') is a HTML table with some input fields in its cells Why doesnt t.getElementsByTagName('tr').firstChild.focus; put the focus on that text field? It...
17
by: Neil Ginsberg | last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a form with a subform (in continuous form view). A combo box on the main form has code in the AfterUpdate event which adds a...
1
by: avnrao | last post by:
Hi, I am facing a problem with control.focus (javascript). Here is the description of the issue. 1. I have 2 aspx files. on Aspx1 I have button named NewRow. Clicking on this, will redirect...
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
11
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
7
by: Dave Booker | last post by:
I am using a WebBrowser object in my .NET 2.0 application, but it is not shown to the user. Every time a timer event triggers it to perform a m_WebBrowser.Navigate() I get that classic IE 'click'...
4
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between...
3
by: jp2express | last post by:
I have several applications that use panels as screens, but I can *not* seem to set the focus for a Textbox. Panel1.BringToFront() Panel1_Textbox.Focus() ' do something with a control on Panel1...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.