Creating 'Pop-Up' Windows |
Author: |
Message: |
Tasha
Senior Member
Posts: 717 Reputation: 81
32 / /
Joined: Jan 2005
|
O.P. Creating 'Pop-Up' Windows
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. Just don't know how. Help please? Thankies. <3
This post was edited on 06-01-2006 at 07:56 PM by Tasha.
www.mycutelobster.co.uk
"Of course it is happening inside your head, Harry,
but why on earth should that mean that it is not real?"
|
|
06-01-2006 07:55 PM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: Creating 'Pop-Up' Windows
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>
This post was edited on 06-01-2006 at 08:10 PM by Nathan.
|
|
06-01-2006 08:03 PM |
|
|
Plik
Veteran Member
Posts: 1489 Reputation: 46
35 / / –
Joined: Jun 2004
|
RE: Creating 'Pop-Up' Windows
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
This post was edited on 06-01-2006 at 08:06 PM by Plik.
|
|
06-01-2006 08:05 PM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: Creating 'Pop-Up' Windows
Oi im still learinign
|
|
06-01-2006 08:09 PM |
|
|
Tasha
Senior Member
Posts: 717 Reputation: 81
32 / /
Joined: Jan 2005
|
O.P. RE: Creating 'Pop-Up' Windows
It should work, but Wordpress is being completely dodgy and changing it after I've entered it.
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...
Help?
www.mycutelobster.co.uk
"Of course it is happening inside your head, Harry,
but why on earth should that mean that it is not real?"
|
|
06-01-2006 08:17 PM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: Creating 'Pop-Up' Windows
Try my one cos it doesnt have the link thing in it soit wont change it
|
|
06-01-2006 08:22 PM |
|
|
Tasha
Senior Member
Posts: 717 Reputation: 81
32 / /
Joined: Jan 2005
|
O.P. RE: Creating 'Pop-Up' Windows
quote: Originally posted by Nathan
Try my one cos it doesnt have the link thing in it soit wont change it
That messes up as well, just doesn't load when you click it.
www.mycutelobster.co.uk
"Of course it is happening inside your head, Harry,
but why on earth should that mean that it is not real?"
|
|
06-01-2006 08:26 PM |
|
|
Nathan
Veteran Member
Yeah, "large dimensions" ;)
Posts: 2984 Reputation: 76
– / /
Joined: Apr 2005
|
RE: Creating 'Pop-Up' Windows
have a look at This Then
That shoulld help
|
|
06-01-2006 08:32 PM |
|
|
Tasha
Senior Member
Posts: 717 Reputation: 81
32 / /
Joined: Jan 2005
|
O.P. RE: Creating 'Pop-Up' Windows
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
www.mycutelobster.co.uk
"Of course it is happening inside your head, Harry,
but why on earth should that mean that it is not real?"
|
|
06-01-2006 09:21 PM |
|
|
Supersonicdarky
Veteran Member
Posts: 2317 Reputation: 48
– / – /
Joined: Feb 2005
Status: Away
|
RE: Creating 'Pop-Up' Windows
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 )
|
|
06-01-2006 09:31 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|