Results 1 to 2 of 2

Thread: Pop image upon visit

  1. #1
    Join Date
    May 2017
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Pop image upon visit

    Not sure if this is the right place to ask. I was trying to do the same pop up intro image like on this page:

    http://4wheelonline.com/Towing/Blue_Ox.207713

    Anyone got some idea? TIA
    Last edited by jscheuer1; 05-30-2017 at 02:51 PM. Reason: format

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,720
    Thanks
    46
    Thanked 213 Times in 206 Posts
    Blog Entries
    52

    Default

    Try this
    Code:
    <script>
    function popup_img() {
    
    var layer=document.createElement("div");
    layer.id="layer_id";
    layer.style.position="absolute";
    layer.style.left=0;
    layer.style.top=0;
    layer.style.right=0;
    layer.style.bottom=0;
    layer.style.background="black";
    layer.style.opacity=0.5;
    
    var popup_img = document.createElement("div");
    popup_img.id="the_popup_img"
    popup_img.style.position="absolute"
    popup_img.style.left="50%";
    popup_img.style.top="50%";
    popup_img.style.maxWidth="500px";
    popup_img.style.transform="translatex(-50%) translatey(-50%)";
    popup_img.innerHTML="<div style='position: relative; color: white; float: right; cursor: pointer; font-family: verdana; font-size: 1em; border: 1px solid white; border-radius: 40px; padding: 5px; width: 20px; top: 35px; text-align: center' onclick='document.body.removeChild(document.getElementById(\"layer_id\")); document.body.removeChild(document.getElementById(\"the_popup_img\"))'>X</div><img alt='' src='http://wierdenland.nl/jupiter.jpg' style='width: 100%'>"
    document.body.appendChild(layer);
    document.body.appendChild(popup_img);
    }
    
    setTimeout(popup_img,2000)
    </script>

Similar Threads

  1. people can't visit my site
    By gib65 in forum Computer hardware and software
    Replies: 4
    Last Post: 06-10-2010, 04:18 AM
  2. Will you visit space in your lifetime?
    By MrLeN in forum The lounge
    Replies: 21
    Last Post: 04-01-2009, 05:26 AM
  3. Script to visit a site
    By dwarfer in forum Looking for such a script or service
    Replies: 2
    Last Post: 07-22-2007, 07:03 PM
  4. How do I only run script on 1st visit?
    By A_Str8 in forum JavaScript
    Replies: 4
    Last Post: 12-20-2005, 04:01 PM

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
  •