473,573 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 19450
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...@ex ample.invalidwr ote:
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...@ex ample.invalidwr ote:
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
2208
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 time and there is also a check on that. If time is empty return error message. Again the explorer returns error message and then shifts the focus...
2
3083
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 Mozilla-only problem) I'm capturing the focus and blur events for the document, updating a
3
6877
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 doesnt give any errors, the focus just doesnt change.
17
3843
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 record to the subform (based on the value of the combo box) and requeries the subform control. I want the focus to return to the combo box on the...
1
2228
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 page to Aspx2 which has a Datagrid. PageLoad of Aspx2 displays the DataGrid with existing data filled in and shows a new row (set of text boxes) in...
4
3939
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 textboxes and a checkbox. The behaviour I want from my app is as follows:- When the textbox (which is prior in tab order to the tab control) has...
11
7325
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 1.7.12 (linux kubuntu). It does work with konqueror. It seems to work with firefox on windows but not with IE (not completly sure though).
7
11910
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' and it steals the focus from the user's current application. How can I prevent the hidden WebBrowser from stealing focus? (And better yet can I...
4
67983
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 these forms that may make one succeed and another fail? In particular, this.window.focus() fails in Opera 9.10 with an "object not found", and...
3
5185
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 Panel2.BringToFront() Panel2_Textbox.Focus() ' do something with a control on Panel2
0
7670
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7740
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5557
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5263
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3703
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2167
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1269
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.