Dialog Modal Popup on page load using Jquery

In this article, in the previous article we learn how to open pop up model on button click but now we discuss how to set a div on page load or how to call a pop up div on page load.


Source Code :-
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
    <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
        rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function () {
            $("#div1").dialog({
                title: "Dialog Modal Popup on page load using Jquery-DEMO",
                width: 360,
                height:450,
                buttons: {
                    Close: function () {
                        $(this).dialog('close');
                    }
                }
            });
        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
      

                <div id="div1" style="display: none">
Hi
                    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                    <script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                    <!-- 300*250 -->
                    <br />
                    <ins class="adsbygoogle" data-ad-client="ca-pub-8436844275140446" data-ad-slot="3267030219" style="display: inline-block; height: 250px; width: 300px;"></ins>
                    <script>
                        (adsbygoogle = window.adsbygoogle || []).push({});
                    </script>
                </div>

        </div>
    </form>
</body>
</html>

Out-Put:-

Dialog Modal Popup on page load using Jquery Dialog Modal Popup on page load using Jquery Reviewed by NEERAJ SRIVASTAVA on 3:03:00 PM Rating: 5

No comments:

Powered by Blogger.