Click to See Complete Forum and Search --> : Link triggering PopUp and targetting anchor?


lazerbrains
10-30-2006, 05:14 PM
I have a page with links in it that I want to trigger a PopUp window. I have accomlished this, but am unsure of the syntax of the link. Right now I have this.

Code for the Pop-Up:
function PopUp(){
window.open("windows/agriculture_livestock_services.html","agriculture_livestock_services","height=600,width=625,scrollbars=yes");
}

and the link I have is:

<a href="javascript: PopUp();" class="textbrown" alt-"agriculture and livestock">Agriculture and Livestock</a>

This works and the PopUp comes up just as expected. Howerver I have anchors in the page that it is opening and I would like the page to target those anchors when opened. How would I go about linking to anchor from this llink? Say, the link name is "anchor2".

Any one know how to do this? :confused:

cyber1
10-30-2006, 05:21 PM
Just add the anchor name to the end of the url

function PopUp(){
window.open("windows/agriculture_livestock_services.html#anchor2","agriculture_livestock_services","height=600,width=625,scrollbars=yes");
}

lazerbrains
10-31-2006, 10:23 AM
I tired what you suggested and it only opened the popup, it did not take me to the named anchor. Any other ideas?

:confused: