Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem detecting idle time and events with frames

Status
Not open for further replies.

pereubu123

Instructor
Jul 25, 2012
2
There are 4 Frames. Main (main) html frame, side (side) html frames and two menu (mainmenu and search)Frames. I need to add code to detect idle timem not to the main, but to all frames or in fact the entire page.

$(document).ready(function(){

idleTime = 0;

var preLoadTimer;
$(this).mousemove(function(e){
//clear prior timeout, if any
window.clearTimeout(preLoadTimer);
….

//create new timeout.
preLoadTimer = window.setTimeout(doPreLoad, 2000);
});

});

Question is what will be document: top.document. or something else? In addition, I want to detect when users move mouse or press key, but I do not have success so far to do that. I tried to to put.top.main.document as document but it want work either.
 
You have to start the reference from the frameset (parent)

parent.FrameName.method or property

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Thanks. That will be for whole frameset page top.document, and for for example for frame main top.main.document. I do not want it for only one frame where is document aspx file located. Through that frame I navigate throughout application. So, I can detect mouse move and key press, when that partcular application is focused?
 
So, I can detect mouse move and key press, when that partcular application is focused

That would depend on where the documents in the frames are being served from. Browsers block cross domain scripting with what is called the same origin policy.






Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top