473,320 Members | 1,802 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.

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 2684
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...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.