Solved

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

Posted on 2007-12-04
14
476 Views
Last Modified: 2010-05-18
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
Comment
Question by:Maverick_Cool
  • 7
  • 4
14 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 500 total points
ID: 20404562
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
 
LVL 7

Author Comment

by:Maverick_Cool
ID: 20404575
ok but will it capture keydown events
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20404880
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
 
LVL 7

Author Comment

by:Maverick_Cool
ID: 20404944
if it is passed on to main page , why cant it capture. it.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20405120
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
 
LVL 7

Author Comment

by:Maverick_Cool
ID: 20405575
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20408634
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
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20880298
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
 
LVL 7

Author Comment

by:Maverick_Cool
ID: 20880549
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
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20880782
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
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20921323
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
 
LVL 1

Expert Comment

by:Computer101
ID: 20953204
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now