focus( ) problem

B

brianwmunz

I have a page that has 3 different iframes in it. The bottom iFrame
continually gets updated as the user adds different images to it
through the interface, and once the user clicks one of the images, I
change the style of the image to put a border around it.
The problem is, once I set off this function to put a border around the
clicked image, the iFrame resets itself. So, if I've scrolled over to
the right a bit and clicked on a pic, the frame resets itself all the
way to the left, so the user would have to scroll back over to see the
pic they just clicked.
I've tried doing an onFocus in the function that adds the style, and
it's not working.

identity=document.getElementById(picid);
identity.focus();

Any ideas?
Thanks.
Brian Munz
 
G

Gérard Talbot

(e-mail address removed) a écrit :
I have a page that has 3 different iframes in it. The bottom iFrame
continually gets updated as the user adds different images to it
through the interface, and once the user clicks one of the images, I
change the style of the image to put a border around it.
The problem is, once I set off this function to put a border around the
clicked image, the iFrame resets itself. So, if I've scrolled over to
the right a bit and clicked on a pic, the frame resets itself all the
way to the left, so the user would have to scroll back over to see the
pic they just clicked.

Can you post an url where all of this description happens? Over here,
it's kinda difficult to follow you or to examine the precise code you
use and to examine what your code does exactly.
I've tried doing an onFocus in the function that adds the style, and
it's not working.

There is no onfocus event attribute for img.
http://www.w3.org/TR/html4/struct/objects.html#edef-IMG
identity=document.getElementById(picid);
identity.focus();

There is no focus method for HTML img element:
http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-17701901
Any ideas?
Thanks.
Brian Munz

Just post an url.

Gérard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top