Welcome to WebmasterWorld Guest from 54.198.222.129

Forum Moderators: incrediBILL

Message Too Old, No Replies

Pop-Up to display only specified part of page

can it be done?

     
5:24 pm on Sep 24, 2001 (gmt 0)

10+ Year Member



Is it possible to display only part of a page in a pop-up window?

I want to somehow specify for the pop-up not to display the top 3 inches of the page it refers to - but to just display everything after that.

I'd be glad of some help on this, friends.

5:38 pm on Sep 24, 2001 (gmt 0)

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Have you tried putting an anchor on the target page, where you want the pop-up display to begin, and then targeting the pop-up URL to the anchor location? (ie- http*//www.mysite.com/targetpage#popup)
5:40 pm on Sep 24, 2001 (gmt 0)

10+ Year Member



Thanks for that Mivox but the page doesn't belong to me so I can't add any anchor to it.

Am I asking for the impossible here?

6:01 pm on Sep 24, 2001 (gmt 0)

WebmasterWorld Senior Member mivox is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I can't think of any way to do it, but someone around here may pop up with a workable solution...
6:38 pm on Sep 24, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I was playing around with scrollBy() and scrollTo() methods. But you would need them to kick in onLoad -- so that technique would also mean changing the code in the pop-up's document as well. Right now I'm stumped.
7:29 pm on Sep 24, 2001 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You could parse it and only display after a certain piece of code but it seems like a lot of overhead.

I assume you want whatever information gets updated other wise you could grab the page content, make your own page and display what you want, maybe with links to the full site.

10:30 pm on Sep 24, 2001 (gmt 0)

10+ Year Member



yes the info updates every day - but the layout remains the same.

> You could parse it and only display after a certain piece of code but it seems like a lot of overhead.

sounds interesting - tell me more

10:56 pm on Sep 24, 2001 (gmt 0)

WebmasterWorld Senior Member nffc is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thinking aloud, display the page in an iframe and position a layer over the top of the stuff you want to hide.
1:03 am on Sep 25, 2001 (gmt 0)

10+ Year Member



Thanks NFFC, that would probably work, though it would leave quite a large heading, albeit blank or in my specified colours.

Since my original post I have found another source where this technique is not required, i.e. no header to worry about.

But if anyone else has a suggestion, I'd be glad to hear it as I'm sure I could find uses for it in the future.

1:31 am on Sep 25, 2001 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I'll give you the parsing info even though you seem to have solved the problem. You could use php to open and read the page and then find an unchangable piece of code (body tag or the last image that you want to leave out) and then use regular expressions and cut off everything before that and prepend you own header. I am not the regex expert but I could ask the guy who does them for me if you really want to know.
10:42 am on Sep 25, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The easiest way to do this is remotely attach an event to the popup window...

<script>
function goScroll()
{
//put your scrolling code here targetting the 'popup' window.
//Use the scrolling methods tedster mentioned.
}

popup = window.open("www.yoururl.com/page.htm","popup")

//you'll need to browser sniff here:
window.top.popup.attachEvent('onload',goScroll) //this one for IE
window.top.popup.onLoad = goScroll() //this one for netscape nav

</script>

This *should* work and should avoid any parsing.

11:34 pm on Oct 1, 2001 (gmt 0)

10+ Year Member



Have you tried applying a negative value to margin-top
1:12 am on Oct 2, 2001 (gmt 0)

10+ Year Member



thanks for your help, chaps

can't get the negative margin to work though - it sounded great ;)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month