Java vs hmtl with Open new window attributes
I have a question. I m thumbnailing images, and i want images to open in new window, i know how to do that now (thanx . But i know theres a way to set the attributes of a new window like if theres a toolbar or statis bar, but as far as i know you can only do that in java. But as i found the code in java, i was dumbfounded as to if you could do this with like a href type, click the picture and it opens a link in a new window. Can anyone help?
TheGraphicsExpe... posted this at 00:42 — 12th July 2000.
They have: 184 posts
Joined: Jun 2000
This'd be a LOT easier if you contact me VIA ICQ.
38389521
Anonymous posted this at 01:17 — 12th July 2000.
They have: 5,633 posts
Joined: Jan 1970
You can specify a specific window (target) to open a document in using HTML.
LINK
However if you want to specify the size of the window, the windows position, or other browser variants (tool bars, resize, etc) you’ll need to use JavaScript.
tazman posted this at 04:56 — 12th July 2000.
They have: 99 posts
Joined: May 1999
I had already posted this to your other question----
If you wish to have a bit more control over the child window that is opened to display the picture, then you can use the following.
In the head section, define a function such as:
function display_me(url){
picture_win=window.open(url,"picture_win"," width=450,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resiza ble=no,left=50,top=50,screenX=50,screenY=50");
}
Then in the link on your thumbnail use
Notes:
Keep the window.open definition on one continuous line, you avoid problems that way.
Make sure you pass either a complete url or a relative url for the picture to the function.
The window.open function is fairly self explanatory. You define the name of the window, the size, location, etc. The first field passed is the http link for the content, the second field is the window name (useful if you wish to refer to the window or close it from the parent window). The third defines the attributes of the new window (size, position, scrollbars or not, etc...)
Hope this is useful
Lloyd Hassell posted this at 16:15 — 15th July 2000.
They have: 231 posts
Joined: Feb 2000
Here is a window opener script that I have made. Enjoy:
var windowFeaturesStr;
function openWindow(URL,NAME,VARNAME,WIDTH,HEIGHT,POSX,POSY,LOCATION,MENUBAR,RESIZABLE,SCROLLBARS,STATUS,TOOLBAR) {
windowFeaturesStr = "";
if (WIDTH) windowFeaturesStr += ",width=" + WIDTH;
if (HEIGHT) windowFeaturesStr += ",height=" + HEIGHT;
if (POSX) windowFeaturesStr += ",left=" + POSX + ",screenX=" + POSX;
if (POSY) windowFeaturesStr += ",top=" + POSY + ",screenY=" + POSY;
if (LOCATION) windowFeaturesStr += ",location";
if (MENUBAR) windowFeaturesStr += ",menubar";
if (RESIZABLE) windowFeaturesStr += ",resizable";
if (SCROLLBARS) windowFeaturesStr += ",scrollbars";
if (STATUS) windowFeaturesStr += ",status";
if (TOOLBAR) windowFeaturesStr += ",toolbar";
if (windowFeaturesStr != "") windowFeaturesStr = windowFeaturesStr.substring(1);
if (VARNAME) eval(VARNAME) = window.open(URL,NAME,windowFeaturesStr);
else window.open(URL,NAME,windowFeaturesStr);
}
:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::
Lloyd Hassell posted this at 16:22 — 15th July 2000.
They have: 231 posts
Joined: Feb 2000
By the way - Java is different from JavaScript. Java is used for creating cross-browser programs such as applets where as JavaScript is used for client-side browser scripting. Just clearing that up.
:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.