Height / Width Defined popup

Support, Discussion, Reviews
Post Reply
User avatar
Akaran_D
Way too much time!
Way too much time!
Posts: 4151
Joined: July 3, 2002, 2:38 pm
Location: Somewhere in my head...
Contact:

Height / Width Defined popup

Post by Akaran_D »

Anyone remember the code for this offhand? I had it written down somewhere, danged if I can find it.

I want the user to be able to click a link, have it open in a new window, but set to a size I dictate and unable to resize it.

Thanks.
Akaran of Mistmoore, formerly Akaran of Veeshan
I know I'm good at what I do, but I know I'm not the best.
But I guess that on the other hand, I could be like the rest.
User avatar
Xouqoa
Way too much time!
Way too much time!
Posts: 4105
Joined: July 2, 2002, 5:49 pm
Gender: Mangina
XBL Gamertag: Xouqoa
Location: Dallas, TX
Contact:

Post by Xouqoa »

<pre>
<script language="JavaScript">
function openWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
</script>

<a href="#" onClick="openWindow('whatever.htm','windowName','scrollbars=yes,width=500,height=150')">link</a>
</pre>

That should do it!
"Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings." - John F Kennedy
User avatar
Akaran_D
Way too much time!
Way too much time!
Posts: 4151
Joined: July 3, 2002, 2:38 pm
Location: Somewhere in my head...
Contact:

Post by Akaran_D »

Thanks Xou!
Akaran of Mistmoore, formerly Akaran of Veeshan
I know I'm good at what I do, but I know I'm not the best.
But I guess that on the other hand, I could be like the rest.
User avatar
Akaran_D
Way too much time!
Way too much time!
Posts: 4151
Joined: July 3, 2002, 2:38 pm
Location: Somewhere in my head...
Contact:

Post by Akaran_D »

Know of a way to make that code automatically size?
Going to be using it to take image thumbnails and have the user click on them to open up the image to its standard dimensions.. but I have many iamges of varying H and W.

That possible? :)
Akaran of Mistmoore, formerly Akaran of Veeshan
I know I'm good at what I do, but I know I'm not the best.
But I guess that on the other hand, I could be like the rest.
User avatar
archeiron
Way too much time!
Way too much time!
Posts: 1289
Joined: April 14, 2003, 5:39 am

Post by archeiron »

Akaran_D wrote:Know of a way to make that code automatically size?
Going to be using it to take image thumbnails and have the user click on them to open up the image to its standard dimensions.. but I have many iamges of varying H and W.

That possible? :)
It is a bit more involved...

First, for your information pop-up blockers tend to stop javascript from opening new windows, so you may want to consider not using javascript because most users won't appreciate having to turn off their blocker or going through the trouble to add your site to the exception list.

It is possible to retrieve the size of an image that has been loaded by javascript. From these dimensional you can adjust the size of a window after it has been opened. If I find some time later today, I may even write up the code for you, but don't count on it! ;)
[65 Storm Warden] Archeiron Leafstalker (Wood Elf) <Sovereign>RETIRED
User avatar
Akaran_D
Way too much time!
Way too much time!
Posts: 4151
Joined: July 3, 2002, 2:38 pm
Location: Somewhere in my head...
Contact:

Post by Akaran_D »

Alright - any way to do it that does not involve using JS?
Akaran of Mistmoore, formerly Akaran of Veeshan
I know I'm good at what I do, but I know I'm not the best.
But I guess that on the other hand, I could be like the rest.
Post Reply