You must Sign In to post a response.
  • Category: JavaScript

    Designing a pop up welcome screen

    website: used C#, ASP.NET as servlet programming

    I want to pop up a welcome screen when any visitor opens my website for the first time.

    I've four pages (home, tutorials, events, books)in my website. The visitor should get the welcome pop up window, when he visits any of the page for the first time. After he visits any of the page, he should not get the welcome screen again when navigating to other pages.

    Again when the visitor re-visits the website, the process should repeat.

    Now my queries are:
    1.How to do build such pop up window?

    2.Can I do it with javascript? but what if javascript is disabled, what are the other ways to do this?

    3.Can I make such choice that the pop up window be shown via javascript but if javascript is disabled pop up window should be shown with the other way????
  • #648360
    Please check the following code to show a modal popup on page load:


    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript">
    function ShowPopup() {
    window.open('popup.aspx', '', 'width=1000px,height=700px,left=' + ((screen.width - 1000) / 2) + ',top=' + (screen.height - 700) / 2 + 'toolbar=0,scrollbars=1,status=0;location=0');
    var windowObject = window.self;
    windowObject.opener = window.self;
    return false;
    }
    </script>
    </head>
    <body onload="ShowPopup();">
    <form id="form1" runat="server">
    <div>
    </div>
    </form>
    </body>
    </html>


    Thanks & Regards
    Paritosh Mohapatra
    Microsoft MVP (ASP.Net/IIS)
    DotNetSpider MVM

  • #648818
    Hello,
    please check below code:

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <title>Modal Popup</title>
    <style type="text/css">
    body{ font-family:Verdana, Arial, serif; font-size:14px;}
    </style>
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script src="jquery.colorbox-min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function()
    {
    $(window).bind('load',
    function(e)
    {
    $.colorbox({opacity:0.3, href:"welcome.html"});
    });
    });
    </script>
    </head>

    <body>

    Regards
    Mr.Rajesh
    Software Engg.


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.