Can make div stretch across iframes, so that i can capture events of div at all places even if the current focus is on any iframe

Can make div stretch across iframes, so that i can capture events of div at all places even if the current focus is on any iframe
LVL 7
Maverick_CoolAsked:
Who is Participating?
 
b0lsc0ttIT ManagerCommented:
Maverick_Cool,

Are you asking if that can be done?  If so, No.  Using layers and CSS you might be able to make a div "cover" iframes on a page but you couldn't have focus in both elements and especially both pages.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
Maverick_CoolAuthor Commented:
ok but will it capture keydown events
0
 
b0lsc0ttIT ManagerCommented:
No, not if the focus is in the iframe.  The iframe could catch the key event and "pass it on" to the main page but the main page couldn't capture the event.

Let me know if you have any other questions.

bol
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Maverick_CoolAuthor Commented:
if it is passed on to main page , why cant it capture. it.
0
 
b0lsc0ttIT ManagerCommented:
I am not sure what you are asking just now but the problem is basically the window with focus.  In a page with an iframe there are 2 windows: the main window, which even has the iframe tag, and the iframe window itself.  Since it seems like you are interested in a key event I will use those and even assume you have set it to the body of the page.  If that is true then whenever a key is pressed anywhere in that body then the event would fire (in theory).  However that body tag is just for the window.  If the focus is in another window then the event isn't fired.

Does that makes sense?  It basically just comes down to different windows.  Script can work between the windows but there is no way for an event in one window to "detect" the same event in another.  You would have to have the event in the other window too.

If any of this is unclear then please let me know what.  I will try to clarify.  If you want to explain what you are trying to do and provide details on the pages then I might be able to suggest a way to do this.  It won't be as easy as what you hoped but could be possible.  One key is whether or not the pages are on the same domain/server.

bol
0
 
Maverick_CoolAuthor Commented:
They are on same domain. i can access 1 iframe from other, but in this case i had go on adding events to each iframe , more it is highly nested.

0
 
b0lsc0ttIT ManagerCommented:
Thanks for letting me know about the domain/server.

Let me know if you have any other questions about this.  You won't be able to do it the way you want but there may be another way to do it that will be better than "adding events to each iframe" and having them "highly nested."  If anything isn't clear then let me know.

bol
0
 
b0lsc0ttIT ManagerCommented:
I don't see any reason to delete this.  You can't is the answer.  I responded to follow ups and provided details but the answer was in the second sentence in my first comment.

Maverick_Cool,

If you feel you can't award the points for some reason then let me know.  If you found a different answer then feel free to provide that too but with what I see and provided I object to the delete.

bol
0
 
Maverick_CoolAuthor Commented:
the answere/waork around that i was getting, i have already tried, like adding to each frame. That case memory/ performance hit will there more, i dont when new iframe will, in sense i am showing xls reports in it, which are complied by excel only, which in case of sheets will have many iframe(auto generated ) and so on. i decided to stop bugging head on this and move on.
0
 
b0lsc0ttIT ManagerCommented:
Since it can't be done I am glad you decided to move on.  However that doesn't change the fact that I provided an answer here.  If you disagree you will need to explain that clearly or the moderator will just go with the info he/she has here.

bol
0
 
b0lsc0ttIT ManagerCommented:
mplungjan,

Just to make it clear to you and the moderator/admin who will look at this I do not object to your recommendation.  Thanks for your time cleaning and I completely agree with the recommendation.  Thanks!

bol
0
 
Computer101Commented:
Forced accept.

Computer101
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.