Welcome screen before website loads (Click to enter) [Splash Screen]

前端 未结 4 1439
闹比i
闹比i 2020-12-05 07:46

How would I create a welcome screen on my website? For example, I have an image and a link that says \"ENTER\" when the user clicks enter the website appears. How would I do

4条回答
  •  猫巷女王i
    2020-12-05 08:38

    You can put your splashscreen in a div on top of your website at the first visit and when the user click on it (or on the "Enter" link), fade it with:

     

    Welcome !

    Take a look at our new products, blablabla Enter on the website

    And with just 3 lines of jQuery:

     $('.enter_link').click(function() { 
            $(this).parent().fadeOut(500);
     });
    

    The splashscreen div need to take the whole space available and have a background to hide the actual content. JSFiddle example: http://jsfiddle.net/5zP3Q/

    Be aware that the splashscreen should be display on the first visit only. For that, use sessions and cookies on server side to decide if you need to display this portion of code or not.

提交回复
热议问题