Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 494
  • Last Modified:

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
0
Maverick_Cool
Asked:
Maverick_Cool
  • 7
  • 4
1 Solution
 
b0lsc0ttCommented:
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
 
b0lsc0ttCommented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Maverick_CoolAuthor Commented:
if it is passed on to main page , why cant it capture. it.
0
 
b0lsc0ttCommented:
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
 
b0lsc0ttCommented:
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
 
b0lsc0ttCommented:
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
 
b0lsc0ttCommented:
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
 
b0lsc0ttCommented:
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now