Shoutbox

Creating 'Pop-Up' Windows - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Creating 'Pop-Up' Windows (/showthread.php?tid=60041)

Creating 'Pop-Up' Windows by Tasha on 06-01-2006 at 07:55 PM

Hey hey,
I need help creating pop-up windows. What I want is like a link, or a thumbnail, and then when you click that, an image comes up in a new window. I think it's something to do with javascript but I haven't a clue.
Bah, I know it's possible. :P Just don't know how. Help please? Thankies. <3


RE: Creating 'Pop-Up' Windows by Nathan on 06-01-2006 at 08:03 PM

code:
<form>
<input type="button" value="Clcki dis button!" onClick="window.open( 'ENTER LINK HERE,'PAGE CONETNT','width=400,height=200')">
</form>

Try that.. that should work (im hoping)

Say you wanted to make it resizeable you would add this code after the hieght/width bit... resizeable="yes"
code:
<form>
<input type="button" value="Clcki dis button!" onClick="window.open( 'ENTER LINK HERE,'PAGE CONETNT','width=400,height=200',resizeable=yes')">
</form>


RE: Creating 'Pop-Up' Windows by Plik on 06-01-2006 at 08:05 PM

code:
window.open("location of thingy to open", "title of window" [optional features])
in features you can set things like the height and width of the pop-up
(e.g. height=100,width=100)

So a link that would open the popup would for example be:
code:
<a href='javascript:window.open("http://shoutbox.menthix.net", "A popup", "height=300,width=300");'>Click to open some dodgy forum</a>

My way is better than his :P
RE: Creating 'Pop-Up' Windows by Nathan on 06-01-2006 at 08:09 PM

Oi im still learinign :P
:refuck:


RE: Creating 'Pop-Up' Windows by Tasha on 06-01-2006 at 08:17 PM

It should work, but Wordpress is being completely dodgy and changing it after I've entered it. :sad:

I entered:

code:
<a href='javascript:window.open("http://shoutbox.menthix.net", "A popup", "height=300,width=300");'>Click to open some dodgy forum</a>

and it changed it to:
code:
<p><a href="javascript:window.open(">Click to open some dodgy forum</a></p>

Just doesn't work... :sad:
Help? :tongue:
RE: Creating 'Pop-Up' Windows by Nathan on 06-01-2006 at 08:22 PM

Try my one :P cos it doesnt have the link thing in it soit wont change it :P


RE: Creating 'Pop-Up' Windows by Tasha on 06-01-2006 at 08:26 PM

quote:
Originally posted by Nathan
Try my one :P cos it doesnt have the link thing in it soit wont change it :P
That messes up as well, just doesn't load when you click it.
RE: Creating 'Pop-Up' Windows by Nathan on 06-01-2006 at 08:32 PM

have a look at This Then
That shoulld help


RE: Creating 'Pop-Up' Windows by Tasha on 06-01-2006 at 09:21 PM

Alrighty then, I got it working. This is my code:

code:
<form> <input type="button" onclick="window.open('http://www.pageresource.com/jscript/jex5.htm','mywindow','width=400,height=200')" value="Click for Full View" /> </form>

Now I want to know how to get that to work as an image, instead of a button.
Thanks! <3
RE: Creating 'Pop-Up' Windows by Supersonicdarky on 06-01-2006 at 09:31 PM

my version (put in body):

code:
<script language="javascript">

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',no-resizable'
win = window.open(mypage,myname,settings)
}

</script>

and for links/images:
code:
<a onclick="NewWindow(this.href,'name','400','400','yes');return false" href="http://shoutbox.menthix.net">f0RUMZ</a>

(i stole the code from the shoutbox before ;))
RE: Creating 'Pop-Up' Windows by Nathan on 06-01-2006 at 09:32 PM

Look here
then change the link bit too something like this:

code:
<a href="LINK HERE"><img src="IMG LINK" border="0" alt="the alternative if the image doesnt load" /></a>

And were you talking to me?
RE: Creating 'Pop-Up' Windows by lordy on 06-01-2006 at 09:45 PM

I'm helping her via MSN atm guys :)


RE: Creating 'Pop-Up' Windows by Tasha on 06-01-2006 at 10:04 PM

Yep, got it completely sorted now. Thanks for everyone's help, especially lordy's. :grin: