?
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
Medium Priority
?
487 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
14 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 2000 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
Technology Partners: 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!

 
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
 
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

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
Suggested Courses

771 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