/    Sign up×
Community /Pin to ProfileBookmark

Need some help with script.

Hi.

I just downloaded the script below and I need some help with it.
It says that the address bar and stautus bar, scroll bar etc. can be disabled by changing the values from 1 to 0 in the href link but I can’t get it to work.
The address and status bar is always there.
How can I get rid of them?
Or is there another script I should use to make a centered popup image without address, scroll and status bar?

[QUOTE]

<!– Paste this code into an external JavaScript file named: centeredPopup.js –>

/* This script and many more are available free online at
The JavaScript Source :: [url]http://javascript.internet.com[/url]
Updated by: Mike Weiner :: [url]http://www.wearebent.com[/url]
Original author: Eric King ([email protected])
Last Updated: May 2006

Changes: Added parameters for optional scrollbars, resizablility,
menubar, toolbar, addressbar, statusbar, fullscreen. Also tweaked the
implementation a bit – links will now give the user a popup window
even if JavaScript is disabled.

Notes: Some parameters are not cross-browser capable (e.g. fullscreen).
Browsers that do not support these abilities will ignore them.

Usage: The link is written as follows:
onclick=”newWindow(this.href, ‘popup’, 600, 500, 1, 1, 0, 0, 0, 1, 0);

Usage Description:
“this.href” refers to the URL given in the “a” tag; “‘popup'” is the name of the popup window;
600 is the width of the popup window; 500 is the height of the popup window; the numbers that
follow designate whether a property is turned on (“1”) or off (“0”), in this order:
scrollbars, resizable, menubar, toolbar, addressbar, statusbar, fullscreen
*/

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
var int_windowLeft = (screen.width – a_int_windowWidth) / 2;
var int_windowTop = (screen.height – a_int_windowHeight) / 2;
var str_windowProperties = ‘height=’ + a_int_windowHeight + ‘,width=’ + a_int_windowWidth + ‘,top=’ + int_windowTop + ‘,left=’ + int_windowLeft + ‘,scrollbars=’ + a_bool_scrollbars + ‘,resizable=’ + a_bool_resizable + ‘,menubar=’ + a_bool_menubar + ‘,toolbar=’ + a_bool_toolbar + ‘,location=’ + a_bool_addressbar + ‘,statusbar=’ + a_bool_statusbar + ‘,fullscreen=’ + a_bool_fullscreen + ”;
var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
if (parseInt(navigator.appVersion) >= 4) {
obj_window.window.focus();
}
}

<!– Paste this code into the HEAD section of your HTML document.
You may need to change the path of the file. –>

<script type=”text/javascript” src=”centeredPopup.js”></script>

<!– Paste this code into the BODY section of your HTML document –>

<a href=”http://www.webreference.com” onclick=”newWindow(this.href, ‘popup’, 600, 500, 1, 1, 0, 0, 0, 1, 0); return false;” target=”_blank”>Visit Web Reference.com</a>
<p><div align=”center”>
<font face=”arial, helvetica” size”-2″>Free JavaScripts provided<br>
by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
</div><p>

[/QUOTE]

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJul 09.2006 — This one, at least:

',statusbar=' + a_bool_statusbar

is supposed to be like this:

',status=' + a_bool_statusbar
Copy linkTweet thisAlerts:
@jubchengauthorJul 09.2006 — Hi.

Thanks for your reply but it is not working.

The grey bar down below is still there.

Only when I open the html file offline it is gone.

It's not only the grey bar down below I want to get rid of.

It's the top titelbar as well, the blue one with the cross on the left to close the window.

I want to get rid of this one too.

It should look like this:

[URL=http://www.mbs-paper.com/IE%20Flash%20Fixedpopup.htm]Link[/URL]

But this is flash and I want it to be just an image not flash.

Hope you can help me out.

Thank you.

Cheng
Copy linkTweet thisAlerts:
@vwphillipsJul 09.2006 — if you just want to display an image a popup is not the only option.

[CODE]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/

function zxcWWHS(){
var winww,zxcwh,zxcsl,zxcst,zxcwc;
if (window.innerHeight){
zxcCur='pointer';
zxcwh=window.innerHeight-20;
zxcww=window.innerWidth-20;
zxcsl=window.pageXOffset;
zxcst=window.pageYOffset;
}
else if (document.documentElement.clientHeight){
zxcCur='hand';
zxcwh=document.documentElement.clientHeight;
zxcww=document.documentElement.clientWidth;
zxcsl=document.documentElement.scrollLeft;
zxcst=document.documentElement.scrollTop;
}
else if (document.body.clientHeight){
zxcwh=document.body.clientHeight;
zxcww=document.body.clientWidth;
zxcsl=document.body.scrollLeft;
zxcst=document.body.scrollTop;
}
zxcwc=Math.round(zxcww/2);
return [zxcww,zxcwh,zxcsl,zxcst];
}


function PopUp(img,w,h){
var popup=document.getElementById('PopUpImg');
popup.src=img;
popup.width=w;
popup.height=h;
popup.style.left=((zxcWWHS()[0]-w)/2+zxcWWHS()[2])+'px';
popup.style.top=((zxcWWHS()[1]-h)/2+zxcWWHS()[3])+'px';
setTimeout(function(){ popup.style.visibility='visible'; },100);
}

document.onclick=function(){ document.getElementById('PopUpImg').style.visibility='hidden'; }

/*]]>*/
</script>

</head>

<body>
<img id="PopUpImg" style="position:absolute;visibility:hidden;z-index:10;" src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" width="10" height="10" >
<span onclick="PopUp('http://www.vicsjavascripts.org.uk/StdImages/One.gif',200,200);" >One</span><br />
<span onclick="PopUp('http://www.vicsjavascripts.org.uk/StdImages/Two.gif',400,300);" >Two</span>
</body>

</html> [/CODE]


is very basic

or

[URL]http://www.vicsjavascripts.org.uk/ImagePopUpII/ImagePopUpII.htm[/URL]
Copy linkTweet thisAlerts:
@jubchengauthorJul 09.2006 — Hi vwphillips.

You are the man!!!

I've been looking for something like this for so long and nobody could help me.

That's what I wanted.

Now I just need to modify it for my needs.

Maybe I'll be back for some help but I hope not.

As I said, you're the man.

Thank you very much.

Cheng

P.S.

One question though.

How do I change the one or the two into a href link?

Is that possible?
Copy linkTweet thisAlerts:
@jubchengauthorJul 09.2006 — Hi vwphillips.

Here is what I've done with it, just to try it out.

[URL=http://www.tommys-service-enterprise.gmxhome.de/test.htm]Link[/URL]

Is there a possibility that the image in the middle of that page, the one that has to be clicked to open the popup looks like a link so that the hand appears and people know it's a link.

Or at least the screentip the one I added that says "click to enlarge", could this one made bigger with a larger font for example?

Otherwise I'm set thanks to you.

One more thing.

If the popup is open and you place the cursor over it the save picture toolbar appears on the top left.

Is there a way to get rid of?

So long.

Cheng
Copy linkTweet thisAlerts:
@jubchengauthorAug 24.2006 — Hi.

Thanks again pointing out this popup option here.

In this script there are the options onclick or onmouseover.

Is there a possobility that the popup works with a timer?

Like if someone open the webpage that let's say after 30 sec. the popup shows up?

If yes please give me an example that I can learn from.

Thank you very much in advance.

Cheng
×

Success!

Help @jubcheng spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...