Results 1 to 2 of 2

Thread: overlay image on home page

  1. #1
    Join Date
    May 2009
    Posts
    6

    Question overlay image on home page

    Hi - I'm using Dreamweaver to create a website - actually it's nearly complete - and now I am told that I have to make an image overlay on the home page advertising a special. I can create the image in any format, that's not my problem, but does anyone know how to put it into the site so that it opens first and foremost and also has a "x close" button so people can navigate away from it? An example of what I need to do is on this website: http://www.dconthefly.com

    Any help is surely appreciated

  2. #2
    Join Date
    May 2009
    Location
    England
    Posts
    165
    Hi dcj,

    First up, let me say I'm not a DW user but I can explain in principle how what you need is done and you can decide whether it's possible in DW or whether you decide to script it yourself.

    You need to create a DIV that is positioned, something like this:

    <style>
    #myAd{
    position:absolute;
    top:10px;
    left:10px;
    display:none;
    }

    <div id="myAd"></div>

    You can then use a bit of javascript to display the DIV when the page loads, like this:

    <body onload="document.getElementById('myAd').style.display='block';">

    All things being well that will make your DIV appear. Of course, as you say, what you put in the DIV is up to you but your example uses an image. The close button is just a clickable area that closes it. So the content of the DIV above would change to something like this:

    <div id="myAd">
    <div style="float:right;"><span onclick="document.getElementById('myAd').style.display='none';">Close me</span></div>
    <img src="images/myFantasticImage.gif" />
    </div>

    I haven't tested this but I'm reasonably confident that it's cross-browser and will work. Hopefully it will at least point you in the right direction.

    Good luck with it.

    Regards,


    David

Similar Threads

  1. Help With Image Map With Rollovers and More
    By porphyrins in forum General Questions
    Replies: 1
    Last Post: 03 Dec 2008, 02:57 AM

Tags for this Thread

Posting Permissions

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