Re: trouble with Javascript Pop-up
- From: djdefpoints <djdefpoints@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 21 Aug 2006 13:06:02 -0700
Let me clarify:
What works: the text link itself, the pop-up window generated
What's wrong: the location of the text link on different monitors (on my
coworker's monitor, for instance, it appears half-way down the page from
where it does on mine.)
Here's the text link code, which appears twice on the main page (and
"wanders" in different browsers):
<a href="testpage2.htm"
onclick="NewWindow(this.href,'mywin','528','600','no','center');return false"
onfocus="this.blur()"><span
style='font-size:7.0pt;letter-spacing:1.0pt;language:EN'>more...</span></a>
Here's the script for the pop-up:
<script language="javascript" type="text/javascript">
<!--
/****************************************************
Author: Eric King
Url: http://redrival.com/eak/index.shtml
This script is free to use as long as this info is left in
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") ||
pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
There is a centering code, but in the script (for the new pop-up window),
not the text link, yes?
What I've done:
-placed text link in different locations, the only one that doesn't shift on
different monitors is at the very top corner of the page
-placed the text link both layered over another object and in free space -
no effect
-used a script that linked an image instead - same problem, except now its a
wandering image.
And no, no master page...learned that lesson my first time here!
--
-no sig necessary-
"DavidF" wrote:
I have never been able to layer a fragment box over any other design.
element...surprised to hear it worked at all. The page generated should be
fixed as far as width. Are you trying some sort of centering code? I have
seen text boxes lengthen when the text size is changed in the browser, but
otherwise the user's monitor shouldn't make a difference. Perhaps if you
explained that in more detail.
You might play with the size of the fragment box...and you aren't using a
master page are you?
DavidF
"djdefpoints" <djdefpoints@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B65485C5-92BC-43C0-81DC-B4E8BBB2BEF0@xxxxxxxxxxxxxxxx
ARGH...happiness short-lived...now the link text seems to wander all over
the
page, depending on the user's monitor settings. From a search of this
site
and some tests, it seems that this is partly due to layering the fragment
over a text-box, but even then, when I move it to the open, the link text
is
placed far down the page, as if making room for items above. Kinda
stumped
how to fix.
--
-no sig necessary-
"djdefpoints" wrote:
I grabbed and modified the following script from the publishermvps site:
<a href="BLOCKED
SCRIPTwindowname_window=window.open'testpage.htm','windowname_window','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=428',
height=480');windowname_window.focus()">More...</a>
I inserted this code fragment into my document, published to web, and
likewise, published-to-web the document called testpage. Both the main
webpage document (called index-test.htm) and testpage.htm reside in the
same
folder on our network server. I assumed I could test this fragment out
before actually putting the documents on our website, but the link
doesn't
work. I get the hyperlink on the page (More...) but when I click on it,
nothing happens. I'm a bit confused.
Side question: will pop-up blockers be a problem for this code snippet?
(I
actually have trouble on this site with that - this posting window gets
blocked.)
Thanks in advance for your help.
--
-no sig necessary-
- Follow-Ups:
- Re: trouble with Javascript Pop-up
- From: DavidF
- Re: trouble with Javascript Pop-up
- References:
- Re: trouble with Javascript Pop-up
- From: DavidF
- Re: trouble with Javascript Pop-up
- Prev by Date: Re: I cannot copy page links in Publisher
- Next by Date: Re: trouble with Javascript Pop-up
- Previous by thread: Re: trouble with Javascript Pop-up
- Next by thread: Re: trouble with Javascript Pop-up
- Index(es):
Relevant Pages
|
Loading