File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes DIV and Object: focus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "DIV and Object: focus" Watch "DIV and Object: focus" New topic
Author

DIV and Object: focus

Chennarao Marvatu
Ranch Hand

Joined: Aug 09, 2004
Posts: 32
Hi friends,
I am exausted by rouding all the sites and all
ok..my problem is i am unable to set the Focus to DIV or Object.
My architecure is like this..
Jsp have a button that launches popup album sideshow.slideshow implemented in Laszlo but this laszlo is running in the jsp DIV. Album contains the
Video file besides images..architecture is like this

DIV (Laszlo div)===>DIV (video DIV)==>this containts IFRAME(media object)
Problem:-- after loading video and playing(autoplaying) if i clicks on LasloDiv the controls are missing only image part is playing...

==> if i click on the screen at the begining and after that video plays then controls are not missing..my conclusion is LaszloDiv is not getting focus so i want to set the focus ..i have been trying how to set the focus to DIV..
Please help me out in this ..ur help is appreciated

Thanks
Chennarao
[ December 15, 2005: Message edited by: Bear Bibeault ]

mchrao
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
A div does not have a focus() method, You may be able to put the focus() on the iframe.

Eric
Sanjiv Jivan
Ranch Hand

Joined: Nov 03, 2005
Posts: 52
span has a focus method. I wonder if you can use that instead of a div.

Sanjiv
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60991
    
  65

Originally posted by Sanjiv Jivan:
span has a focus method.


No, it does not.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sanjiv Jivan
Ranch Hand

Joined: Nov 03, 2005
Posts: 52
The Microsoft reference says it does.

http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/span.asp

Sanjiv
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
IE says one thing, but the other browsers do not follow it.

If you look at the W3C specs it will most likely say something like: This attribute may be used with the following elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON. (Too lazy to find it.)

To make a point, this code should have an alert if the browser supported it:


It does nothing for me.

Eric
Sanjiv Jivan
Ranch Hand

Joined: Nov 03, 2005
Posts: 52
Oddly it doesn't event work with IE!

Here's the w3c link.
http://www.w3.org/TR/REC-html40/interact/scripts.html#adef-onfocus

A and AREA also are focus'able.

Sanjiv
Chennarao Marvatu
Ranch Hand

Joined: Aug 09, 2004
Posts: 32
Thanks for your reply..
I can not use span or IFRAME for my requirement because media player controls(play,stop) required inorder to display video.And also span always inline text it can not provide multiple layers..i am using DIV on another DIV like this..

Thanks
Chennarao
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What is your exact markup code. Sounds like it could just be an issue with that.

Eric
 
Don't get me started about those stupid light bulbs.
 
subject: DIV and Object: focus