JavaScript Popup?


Does anyone know how i can do this? Basically the client of this website wants a pop-up to appear when someone visits the homepage…

It’s slightly hard to explain to i have attached an image so you can see what it should look like.

How can i do this? I need a survey to pop-up and appear and enable users to close the box with a “X” cross. See image attached…

Thanks again

I assume you mean one where the background is greyed out. These are commonly called “lightboxes”. A search like this will bring up pages with lists of them for you to try out.

By the way, these things are pretty annoying. When I first visit a page, I want to read what’s on it, not be asked “would you mind completing a survey at the end of your visit?” when my visit has barely just started. It’s off-putting.

1:create a div dom
2:set div style. e.g height,width,background,position,z-index ,boder etc. you should set the “position” attribute is Absolute that It is necessary.
3:get the width and height of document using javascript.and compute the top,left for this div.
4:please append this dom in the document.body.
5:close buttom bind a click event when triggering set this div display is none.