|
-
Apr 29th, 2003, 09:45 AM
#1
Thread Starter
Lively Member
Pages Being Loaded 'naked' . . . frames & java
ok so i've got a little further .... the following code allows u to redirect a user back to a frameset if the page is loaded outside of its original frameset.
PHP Code:
<script>
if (window.name!='Main'
&& !((self.innerHeight == 0) && (self.innerWidth == 0)))
top.location.replace('frame1024.htm?Home.aspx~main');
</script>
now i need to add an else statement to detect there screen size ... how do i do this
many thanks
optimus
-
Apr 29th, 2003, 10:07 AM
#2
There is no cross-browser way for this. In IE you can use the screen object.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 29th, 2003, 10:09 AM
#3
Thread Starter
Lively Member
yeah i've got some code for that 2secs
-
Apr 29th, 2003, 10:12 AM
#4
Thread Starter
Lively Member
@ the mo my code on my index page redirects the users to the required frame but ... im not so brilliant with java/html n need to know how to edit the above piece of code to do what this one does kind of
PHP Code:
var correctwidth=1024
var correctheight=768
if (screen.width!=correctwidth||screen.height!=correctheight)
MM_goToURL('parent','frame800.htm');
so the process of events would be
if ... not loaded in frame then
if ... 1024x768 redirect to frame1024.htm
else ...800x600 redirect to frame800.htm
end if
end if
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|