Can someone me t开发者_如何学Co open the modal popup when a vistor requests the page for the very first time, a cokie hides it thereafter. I need to do a survey. They answer one question and are redirected so a close button or submit button is not needed. Im using php.
Thanks for the help. Bruce
Are you allowed to use jQuery? I would user jQuery + jQuery-UI (http://jqueryui.com/demos/dialog/)
What you have to do is just define a Div element with the markup of the popup, and then invoke the popup method used by jQuery UI in the document ready event.
e.g.
$(document).ready(function() {$( "#dialog" ).dialog();});
and
<div id="dialog"> Here goes your survey form</div>
Also it is a good idea to load jQuery and jQuery-UI from a CDN, like google's, use these addresses:
https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js
Hope this helps
精彩评论