Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: window

  1. #1
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    window

    I need help here. I want to put a flying announcement window on my page. I need something that I can show my users an announcement when they load my site. I don't want a pop up as such but a window on top of the entrance page that they can read the announcement and then close it when they are done.

    I know how to place a fixed window on it but i want to be able to allow them to close it when done by clicking on the word "close". Does this make sense?

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    See if this code helps
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <style type="text/css">
    #message{width:300px;height:100px;margin:1px auto;background:#efefff;border:1px dotted #222;text-align:center;}
    #close{font-size:7pt;float:right;line-height:140px;cursor:pointer;}
    </style>
    <script type="text/javascript">
    window.onload = function()
    {
    	document.getElementById('close').onclick = function()
    	{
    	document.getElementById('message').style.display = 'none';
    	}
    }
    </script>
    </head>
    <body>
    <div id="message">
    Read This please
    	<span id="close">Close</span>
    </div>
    </body>
    </html>
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thank you

    Thank you rangana

    This is exactly what I was looking for. I appreciate the help.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,677
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    And here’s a good article/tutorial on DHTML popups that might be of interest.


  •  

    Posting Permissions

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