Nightfly Posted August 15, 2013 Share Posted August 15, 2013 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?? Anyone can help????? Best Regards João Carrolo Quote Link to comment https://forums.phpfreaks.com/topic/281215-my-first-post-how-to-build-an-box/ Share on other sites More sharing options...
Psycho Posted August 15, 2013 Share Posted August 15, 2013 (edited) [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 August 15, 2013 by Psycho Quote Link to comment https://forums.phpfreaks.com/topic/281215-my-first-post-how-to-build-an-box/#findComment-1445213 Share on other sites More sharing options...
Nightfly Posted August 15, 2013 Author Share Posted August 15, 2013 Thank you very much for your example... If anyone have any more examples can placed here... Best Regards João Carrolo Quote Link to comment https://forums.phpfreaks.com/topic/281215-my-first-post-how-to-build-an-box/#findComment-1445245 Share on other sites More sharing options...
Psycho Posted August 15, 2013 Share Posted August 15, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/281215-my-first-post-how-to-build-an-box/#findComment-1445249 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.