Elo ppl.
iam stuck with my game cuz i cant figure out how to make the correct "update- player from location, and show bla bla.".
so instead iam making it easier for myself and want to just open a new window when i press specific options in the game.
like Character overview wich shows stats and such, when i press that link on screen.
it should open a small window on top of the other big main screen, with only exit option available in that smaller window. properties should be around width:650px, height 550px, border 3px.
and it should dim out the background slightly.
just like some pop-ups is on top of windows screen.
anyone have an idea how the code looks like ? (searching the net also atm...
can it be done with php at all.
help with open a new screen. (much like a popup)
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: help with open a new screen. (much like a popup)
You will need Javascript to do something like that (well, not to do a pop-up, but to do it well with the faded background so it doesn't get blocked you do). However, there is a very easy to use jQuery plugin that does exactly this, including the fading background.
1. Download jQuery here.
2. Attach jQuery to the page with the script tag:
3. Download a jQuery plugin called Greybox 2. I couldn't find the plugin online (I got it from the CD of a jQuery book), so I zipped it up and uploaded it here. You don't need to pay for an account to download it.
4. Attach the greybox2.css file:
5. Attach the greybox2 file to the page with another script tag (make sure it is under the jquery file)
6. Add a class of ".openWindow" to any link you want to open the pop-up, and have the links point to the page you want the pop-up to open
7. Add this to the page:
The gbOptions part of the code controls the display options for the pop-up. You can change the width, height, and caption height. Don't worry about "ffMacFlash". That is an option to fix a bug having to do with showing Flash movies in Safari for Mac.
And that is it! Now you can make faux pop-up windows that won't bother pop-up blockers and if used right, won't annoy people by opening all kinds of other browser windows (the windows in greybox are not actual pop-up windows, they are made in JS). If you want to see the effect before hand to make sure it is what you are looking for go to this page and click on the Google, Yahoo!, etc. links near the bottom. However, that is the old version of greybox that is much harder to work with. Greybox2 is much easier, as you can see above
1. Download jQuery here.
2. Attach jQuery to the page with the script tag:
Code: Select all
<script type="text/javascript src="jquery142.js"></script>4. Attach the greybox2.css file:
Code: Select all
<link href="greybox2.css" rel="stylesheet" type="text/css">Code: Select all
<script type="text/javascript" src="jquery.greybox2.js"></script>7. Add this to the page:
Code: Select all
<script type="text/javascript">
$(document).ready(function( ) {
var gbOptions = {
gbWidth: 600,
gbHeight: 500,
captionHeight: 22,
ffMacFlash: true
};
$('.openWindow').greybox(gbOptions);
</script>And that is it! Now you can make faux pop-up windows that won't bother pop-up blockers and if used right, won't annoy people by opening all kinds of other browser windows (the windows in greybox are not actual pop-up windows, they are made in JS). If you want to see the effect before hand to make sure it is what you are looking for go to this page and click on the Google, Yahoo!, etc. links near the bottom. However, that is the old version of greybox that is much harder to work with. Greybox2 is much easier, as you can see above
The indelible lord of tl;dr
Re: help with open a new screen. (much like a popup)
coolio.
i will try it out. and yes, the link you showed at bottom is about what iam thinking about.
thanx alot Lantern =))
i will try it out. and yes, the link you showed at bottom is about what iam thinking about.
thanx alot Lantern =))