SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    NY
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Those full-window "layer" splash ads?

    Hi there,

    You've probably seen 'em, a top layer ad that loads on first visit; autohides after certain seconds or when you click skip ad. It's actually the same webpage (no forwarding or anything), and the ad just gets hidden probably via the display property.

    I've Googled for a script like that but without any successful. I know it's out there and it's just that I'm not using the right keywords.

    Anyone?

  2. #2
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    NY
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Portsmouth UK
    Posts
    1,497
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok but tomorrow

  4. #4
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    NY
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not today?

  5. #5
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm... well, I'm not sure how the ad networks do it, but I wrote one for you...

    Code:
    <script type="text/javascript">
     function CloseAd()
     {
     	el = document.getElementById('ad');
     	el.style.display = 'none'; // Hide the ad.
     }
     function ShowAd()
     {
     	el = document.getElementById('ad');
     	el.style.display = 'block'; // Show the ad.
     	el.innerHTML = '<div id="adbar">This ad will disappear in 5 seconds. <a href="javascript:CloseAd();">Skip</a><br/><iframe src="ad.html"><!-- You can put an ad here as a default for people who have no iframe support --></iframe>';
     
     	setTimeout('CloseAd();', 5000); // 5 seconds to hide.
     }
     window.onload = function()
     {
     	ShowAd();
     }
     </script>
     <style type="text/css">
     #ad
     {
     	width: 100%;
     	height: 100%;
     	position: absolute; /* Go over everything */
     	background: #fff; /* This line hides stuff behind it */
     
     	display: none; /* By default, we don't show it, for the benefit of the SE's. */
     }
     
     /* Optional: */
     #adbar
     {
     	background: #000;
     	color: #fff;
     	width: 100%;
     	height: 50px;
     }
     iframe
     {
     	position: absolute;
     	top: 50px;
     
     	width: 95%;
     	height: 100%;
     }
     </style>
     
     <div id="ad">
     	<!-- Leave this here, empty. -->
     </div>
     
     <div id="content">
     <!-- Your standard content spot -->
     	Hello world, how are you today?<br/><br/>Oh you're good? That's nice to hear.<br/><br/>More content etc. etc.
     </div>
    Enjoy. Hope it's what you're looking for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •