Hi everyone, I want to know how do I create a pop up box when some clicks on a text or link.. for example: Click here.. for our opening hours Where it says "click here" I want a small box to appear to show opening hours when its been clicked.. Thanks Best Regards
I believe you are talking about a link that opens a page in a separate pop-up window, if so this should work: <script type="text/javascript"> var openwindow; function popupWindow(url) { popup = window.open(url,'name','height=200,width=500'); if(window.focus) {popup.focus()} } </script> <html> <head> <title>My Page</title> </head> <body> <a href="javascript:popupWindow('myfile.html');">Link</a> </body> </html> Code (markup): Replace myfile.html with the source file you want to display, and just adjust the height and width.
Are you sure you want a popup?, Possibly blocked by browsers, If people want to print your opening times there is no menu bar, harder for SEO to find. etc etc Just a thought.
I use nyromodal for most of my smooth box stuff. If you want a simple alert that would work. Very old school but simple. Stealth has the other option. You can also add menubar, toolbar, etc to make it behave like a true browser window.