Popup window once a day!

Hello dear friends ,
I Saw that there are html experts in this site ,
So i need an HTML code for popup window Code…
I Need features like :
1) There will be an popup window on page load
2) The popup window will appear only once for one visitor in 24 hours.
3) I will point a domain name so the pop up window will show my website in Popup window…

SORRY FOR BAD ENGLISH !!

I Really need this code Urgent…

Thanks in advance.

Welcome to the forums, @Chitrangad1.

I’ve moved your post to the JavaScript forum, because you cannot do what you want with HTML alone.

Have you made a start on this yourself? If so, please show the code you have so far. You will find people willing to help you with it, but you’re unlikely to find anybody to do it for you.

1 Like

Where are you thinking of putting this code, if the popup is going to show your own website?

1 Like

There are plenty of popup tutorials on the web, as well as a large array of libraries and plugins for other view-related libraries. As @TechnoBear said, if you have a specific problem please post your code here, and/or set up a fiddle or the like! :-)

This can be done by storing the last date of execution to the local storage and an ordinary if condition.

I think you basically have two options here: either use an iframe, or load the content sending an XMLHttpRequest to that page. The advantage of the former is that it is isolated from the containing page and the styles and scripts won’t interfere with each other. Reversely, the advantage of the latter is that you have more control over the exact content, behaviour and appearance – such as displaying only a certain element instead of the whole thing including header, footer etc.

Again, as for matters of detail please post your code-so-far. If you need it reaaally urgent, I might suggest something I usually wouldn’t w/o further specifics and say pull jQuery and jQueryUI. ;-) Then just use a dialog and load the content.

I am going to put this code on my index page …

@TechnoBear i have already added the pop up code on my website.
But i want the popup window comes only once in 24 hours for each visitor.
So the visitor will also not get annoyed. …

Hello friends,
I Already have an pop up window running on my website.

<!DOCTYPE html>
<html>
  <head>
    <meta charset=utf-8 />
    <title>ColorBox demo</title>
    <link rel="stylesheet" href="http://www.jacklmoore.com/colorbox/example1/colorbox.css" />
  </head>
  <body>
    <h1>Hello, there!</h1>
    <h2>This is some content</h2>
    <p>The popup will open in five seconds</p>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="http://www.jacklmoore.com/colorbox/jquery.colorbox.js"></script>
    <script src="jquery.cookie.js"></script>

    <script>
      function openColorBox(){
        $.colorbox({iframe:true, width:"80%", height:"80%", href: "http://www.sitepoint.com"});
      }
      
      if(!$.cookie("colorboxShown")){
        openColorBox();
        $.cookie('colorboxShown', true, { expires: 1, path: '/' });
      }
    </script>
  </body>
</html>

This code is made by @James_Hibbard in This Thread.

I Have copied that code and putted it on my website , but i got complaints by my visitors to remove the popup window as it is loading everytime when the page loads.
Thats why i need an code :-
Popup window will only comes once in 24 hours for EACH VISITOR.
Thanks In advance.

Although the jQuery cookie library is deprecated, the code you posted should work. Have you got a link to your page.

Yeah

I think what @James_Hibbard meant was “Please post a link to your site so we can see the problem”.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.