/    Sign up×
Community /Pin to ProfileBookmark

onmouseover Help

I have an iFrame on a page that onmouseover I want to put focus back on the main page (pretty sure that is what I need). Basically, I tried using this:

onmouseover=”window.document.focus()”

…to make it so when I roll over the iFrame it doesn’t let me scroll in the iFrame only the main page (until onclick or something). But I added (above) to the iFrame tag and the body tag of the iFrame src but it doesn’t work. This can’t be that difficult can it?

Thanks,
Jr-

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJun 17.2005 — onmouseover="top.document.focus()"
Copy linkTweet thisAlerts:
@Jr-authorJun 17.2005 — hmm... doesn't really work. It does the same thing what I had before did. It just brings the window to front but I still can't scroll in the main window when I'm over the iFrame.
Copy linkTweet thisAlerts:
@phpnoviceJun 17.2005 — Probably because it keeps fighting over the focus. Maybe you could put a transparent DIV or non-scrolling IFRAME over the top of your scrolling IFRAME so that it can't receive the focus in the first place.
Copy linkTweet thisAlerts:
@Jr-authorJun 17.2005 — hmm... I'll try the Transparent DIV (good idea). Thanks for the speedy help.
Copy linkTweet thisAlerts:
@Jr-authorJun 17.2005 — ok... one more question... if I want the 'clear' <div> tag to come up onload can i do that without putting the onload event in the body?
Copy linkTweet thisAlerts:
@phpnoviceJun 17.2005 — Yup, just use [b]window.onload = function() { ... };[/b] anywhere in the page.
Copy linkTweet thisAlerts:
@Jr-authorJun 17.2005 — thanks again for the help... all works fine now.
Copy linkTweet thisAlerts:
@phpnoviceJun 17.2005 — Cheers.
×

Success!

Help @Jr- spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...