Jump to content

Recommended Posts

Dear Community.

 

I want to build a windows to place an link inside it, but if i press the "X" the window must disapear/close, the near example is this on google, so, can anyone tell me the code to build an window like this one used on google??

 

window.jpg

 

Anyone can help?????

 

 

Best Regards

João Carrolo

Link to comment
https://forums.phpfreaks.com/topic/281215-my-first-post-how-to-build-an-box/
Share on other sites

[This isn't a PHP issue, moving post to the JavaScript forum]

 

It is most likely just a DIV. Inside that div there is the X element with an onclick trigger attached to it which calls a javascript function to change the display property of the div so it doesn't display.

 

Here is a very ROUGH example script

<html>
<head>
<script type="text/javascript">

function closeDiv(divID)
{
    document.getElementById(divID).style.display = 'none';
}

</script>
</head>
<body>
This is some random content on the page
<br><br>

<div id="dialog" style="width:200px; border: 1px solid black;padding: 3px;">
    <div style="text-align:right;" onclick="closeDiv('dialog');">X</div>
    <div style="padding:10px;">Click the 'X;' to close this dialog<br><br></div>
</div>

This is some other random content on the page

</body>
</html>
Edited by Psycho

That's the point - it is an example. It is up to you to build it however you want it to look. Or, if you want to get really fancy you can use the JQuery UI: http://jqueryui.com/dialog/

 

But, that also requires YOU to actually do some work and you would have to know something about coding in JavaScript to get it working appropriately. If you are just wanting someone to code this for you, then I can move your post to the freelance forum.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.