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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Take User to Specific Place on Popup HTML Page? 1

Status
Not open for further replies.

flasher40

Technical User
Apr 13, 2007
80
US
Hi, I'm using the following code to open one html page as a popup while on a different html page:

<SCRIPT language="JavaScript">

function load() {
var load = window.open('stereo_camera_platform_details.html','','scrollbars=yes,resizable=yes,fullscreen=yes,toolbar=no,location=no,status=no,menubar=no');
}
</script>



<a href="javascript:load()"><strong><font color="#7C0019">
<FONT FACE="arial" SIZE="2" COLOR="#7C0019" onmouseover="this.style.color='#3300FF'" onmouseout="this.style.color='#7C0019'">
CLICK HERE</font></strong></a> <font color="#000000">
for a step-by-step explanation.


In one case, I'd like to modify the above code so that when the popup window is opened, the user is taken to a specific place on the html page instead of being at the beginning of the page. Is there a way to do that? I assume some kind of code would have to be embedded in the popup html and referenced in the code shown above.

Thanks,
Bill
 
Hi

JavaScript:
<script type="text/javascript">
function load([red]where[/red]) {
  [red]where=where?'#'+where:'';[/red]
window.open('stereo_camera_platform_details.html'[red]+where[/red],'','[gray]...[/gray]');
}
</script>
HTML:
<a href="javascript:load()">CLICK HERE</a> for open pop-up

<a href="javascript:load([red]'lets_say_second_chapter'[/red])">CLICK HERE</a> for open pop-up and scroll to relevant part
And in the document you open in the pop-up window have something like :
HTML:
[gray]...[/gray]

<h2><a name="[red]lets_say_second_chapter[/red]">Second Chapter</a></h2>

[gray]...[/gray]

Feherke.
 
Feherke,

Your suggestion works, sort of. But when the pop-up occurs, there is no scroll bar to scroll from that point. Any other suggestions to fix that?

Thanks,
Bill
 
Does the content go outside of the browser window - i.e. is there any reason a browser would show them?

If you remove the "fullscreen" attribute, and shrink the window, do you see scrollbars when the content is too big for the window?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top