Log in

View Full Version : Popupbox script



Jordy
12-29-2009, 02:41 PM
1) Script Title:
Popup Box (DHTML Announcement Box)

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex11/abox.htm

3) Describe problem:
Hello,

In this script I want that people can't drag and drop the box. Can you please change the script that drag & drop is not possible? I want only the script for the box.

Kind regards,
Jordy

I dont speak English very well, sorry:-)

jscheuer1
12-29-2009, 03:01 PM
Change this:


<td id="dragbar" style="cursor:hand; cursor:pointer" width="100%" onMousedown="initializedrag(event)">

to:


<td id="dragbar" width="100%">

Jordy
12-30-2009, 07:22 AM
Ok, thank you very much! And what Javascript should I delete?

jscheuer1
12-30-2009, 08:41 AM
None.

Jordy
01-01-2010, 04:16 PM
Ok, I have another question.

How can I change the script that the script don't show the box on the page standard, but only if you click on a link with SHOW BOX?

I hope you understand me, my English isn't very good:D
Jordy

jscheuer1
01-01-2010, 04:42 PM
Change:


<div id="showimage" style="position:absolute;width:250px;left:250px;top:250px">

to:


<div id="showimage" style="visibility:hidden;position:absolute;width:250px;left:250px;top:250px">

Make a link somewhere else on your page:


<a href="#" onclick="document.getElementById('showimage').style.visibility = 'visible';return false;">SHOW BOX</a>

Jordy
01-01-2010, 05:29 PM
Ok, and one more question:-)

How can I add the box visibility to a link?

For example:
this is the link:

header("Location: http://mysite.com/index.php?p=cl");

And I want that if you click on this link you will see the box.

jscheuer1
01-01-2010, 07:04 PM
That's not a link. Could you please explain more fully what you want to accomplish?

Jordy
01-02-2010, 03:30 PM
On every page a user don't see the tutorial. But if he comes to a page called instructions, he will standard see the tutorial.

jscheuer1
01-02-2010, 03:44 PM
Then only put the tutorial on the instructions page.

Jordy
01-02-2010, 03:47 PM
Yes, but a player can click on all the pages on the link Show Box, but if he comes on a page called instructions the tutorial is standard showed

jscheuer1
01-02-2010, 04:55 PM
You are being cryptic. I know you don't mean to be. It appears you have some kind of PHP setup for various pages. My understanding of PHP is limited. But what really matters is what is served to the user. They don't get PHP, they get HTML. So all you have to do is to arrange things so that PHP sends the HTML that you want. I can probably tell you what that HTML should look like, but I may not be able to tell you much about how to get your PHP to do that. We have a PHP forum for that part.

If I had a link to the page where you want the tutorial to appear, and a link to the tutorial, I might be able to help out some more.

The most basic solution would be to use a PHP include inside here:


<!-- PUT YOUR CONTENT BETWEEN HERE -->

<?php include code goes here ?>

<!-- END YOUR CONTENT HERE -->

Have that include be determined by some sort of variable from GET, POST, or SESSION, etc.

I'm really not clear though. Do you want a pop up box on all pages, with different content on one or more pages, or to only have a pop up box on the instructions page?

Jordy
01-03-2010, 01:04 PM
I want a link to open the popupbox on all the pages, but on the instructions page it is standard open.

For example, normal pages: http://www.mysite.nl/page.php
Link to instructions page:http://www.mysite.nl/instructions.php?box=yes&open

jscheuer1
01-03-2010, 02:39 PM
I think I get it then. The easiest thing would be just to have, on the instruction page:


<div id="showimage" style="position:absolute;width:250px;left:250px;top:250px">

instead of:


<div id="showimage" style="visibility:hidden;position:absolute;width:250px;left:250px;top:250px">

If for some reason that's impossible, you could have on all pages:


<?php
if($_GET['box'] === 'yes'){
$boxVis = 'visible';
} else {
$boxVis = 'hidden';
}
?>
<div id="showimage" style="visibility:<?php echo $boxVis; ?>;position:absolute;width:250px;left:250px;top:250px">

Note: If the showimage division is in an include, you may have to pass that include the GET data.