473,796 Members | 2,632 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 19461
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
2222
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 to date field, again error message and focus goes to time and this story goes on and on, untill...
2
3111
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
6897
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
3866
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 main form when it's done, but I can't get it to do so if the user enters a value and presses Enter...
1
2246
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 the Footer Item. Now, when I set the focus by accessing the first text box in the Footer
4
3951
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 been filled with a certain length of text by the user, the focus is
11
7347
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
11931
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 even suppress that click?_
4
68052
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 windows.focus() succeeds in Opera 9.10, Firefox 2.02, and IE 7.
3
5198
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
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10190
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10019
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7555
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4122
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
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.