473,460 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

On Page Load, Set Focus of Browser to specific point in a Large image

I am developing a kiosk application, this will not have a keyboard or
mouse for use.

The system rotates through a series of images - no problem

One image is very large, like this one...

http://radar.weather.gov/Conus/Loop/NatLoop.gif

I want to browser focus to be on Georgia (bottom Right) when the image
loads instead of the default Washington State (Top Left)

I have tried image maps and other onMouse events, but this needs to
occur automatically not when someone touches the mouse or keyboard,
since the system will not have any interaction from a human...

any ideas?

Oct 16 '06 #1
2 2689
ke****@gmail.com wrote in news:1161032213.380933.193550
@i3g2000cwc.googlegroups.com:
I am developing a kiosk application, this will not have a keyboard or
mouse for use.

The system rotates through a series of images - no problem

One image is very large, like this one...

http://radar.weather.gov/Conus/Loop/NatLoop.gif

I want to browser focus to be on Georgia (bottom Right) when the image
loads instead of the default Washington State (Top Left)

I have tried image maps and other onMouse events, but this needs to
occur automatically not when someone touches the mouse or keyboard,
since the system will not have any interaction from a human...
Look into scrollTo:

window.scrollTo(x-coord, y-coord)

Oct 16 '06 #2

<ke****@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
I want to browser focus to be on Georgia (bottom Right) when the image
loads instead of the default Washington State (Top Left)
You can use CSS to set the image as a background-image with a negative
position, e.g.:

body {
margin: 0; padding: 0; border: none; overflow: hidden;
position: relative; width: 100%; height: 100%;
background: white url(natloop.gif) -[x_offset]px -[y_offset]px no-repeat;
}

If you don't know window dimensions, you can set the background-position
property in a window.onload function. I believe the following will do it in
most browsers:
----------------------
var x = [x offset in image to center of Georgia] - (window.innerWidth ?
window.innerWidth : (document.documentElement.clientWidth ?
document.documentElement.clientWidth : document.body.clientWidth))/2;

var y = [y offset in image to center of Georgia] - (window.innerHeight ?
window.innerHeight : (document.documentElement.clientHeight ?
document.documentElement.clientHeight : document.body.clientHeight))/2;

document.getElementsByTagName('body')[0].style.backgroundPosition='-' + x +
' -' + y
----------------------

You can also put the image in a relatively-positioned DIV and
negatively-offset the top and left of the DIV.

nf

Oct 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Charles Eubanks | last post by:
The enclosed html snippet displays an area map. The behavior I want is for each area to show up (eg show the outline of the poly) when the user mouses over it. This happens nicely BUT in order...
22
by: Jonathan Snook | last post by:
I've been contemplating what the recommended usage of a "top of page" link should be? Should there only ever be one at the bottom of the page? Should they be sprinkled at various points on the...
2
by: Dave Bootsma | last post by:
Is it possible to programatically save a certain image from a certain web page? I want to automatically get a specific graphic from a specific web page programatically so I can automate the...
18
by: J-T | last post by:
Hi All, There is a picture on the following URL which I want to have it in one of my asp.net pages .I mean I want to embed the content of this page in my own page and get its image.Is there a...
23
by: Peter | last post by:
I have a problem with a page show_image.asp that returns a jpg image under Windows XP Pro SP2. The page sets content type as: Response.ContentType = "image/jpg" While this works perfectly fine...
42
by: smerf | last post by:
Using javascript, is there a way to trap an external page inside a frame? I've seen scripts to break out of frames, but nothing to keep a page trapped in a frame.
1
by: | last post by:
I've built an application that scrapes JPG images of webpages and PDF instances of those webpages automatically from an RSS feed. References to the scraped resources are persisted to our database....
0
by: minimini1015 | last post by:
I hava an iframe inside my default.aspx, and i have put another aspx (map.aspx) inside the iframe. In the map.aspx, it has a drag panel and a large image (actually a floor plan) inside it. I have...
3
by: randy.buchholz | last post by:
I have been encountering strange behaviour on client machines where the pages truncate the display in the middle of the page. At some point the browser just goes white from one line to the bottom...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.