Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DIV and Object: focus

 
Chennarao Marvatu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A div does not have a focus() method, You may be able to put the focus() on the iframe.

Eric
 
Sanjiv Jivan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
span has a focus method. I wonder if you can use that instead of a div.

Sanjiv
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sanjiv Jivan:
span has a focus method.


No, it does not.
 
Sanjiv Jivan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Microsoft reference says it does.

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

Sanjiv
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your exact markup code. Sounds like it could just be an issue with that.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic