Results 1 to 8 of 8

Thread: Drop-in content box

  1. #1
    Join Date
    Nov 2004
    Location
    Texas
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drop-in content box

    http://www.dynamicdrive.com/dynamici.../dropinbox.htm

    Could someone help me modify this script to have a timer? I would only like the box to display for 10 days.

  2. #2
    Join Date
    Sep 2004
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i'm working on it

  3. #3
    Join Date
    Nov 2004
    Location
    Texas
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks.

  4. #4
    Join Date
    Sep 2004
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry but it might be another day, i have got a lot of work to do, but if someone else does not get back before i do then i'll get it for you hope thats ok

  5. #5
    Join Date
    Sep 2004
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    see if you like this....

    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 2</title>
    <script language="JavaScript1.2">
    
    // Drop-in content box- By Dynamic Drive
    // For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
    // This credit MUST stay intact for use
    // Date plugin by Nate_Bro 
    
    var ie=document.all
    var dom=document.getElementById
    var ns4=document.layers
    var calunits=document.layers? "" : "px"
    
    var bouncelimit=32 //(must be divisible by 8)
    var direction="up"
    
                 d = new Date();
       var     dt1 = (d.getMonth() + 1);
       var     dt2 = d.getDate();
       var     dt3 = d.getYear();  
       
       
       
                                               // Date format is MM/DD/YY
       var enddate = "11/25/2004"              // End date, the day you want the box to NOT show on ########### EDIT ############
    
    
    
    
    		var date3 = enddate
    		var lead_slashes = date3.indexOf("/");
        	var start = lead_slashes + 1;
    		var without_resource = date3.substring(start,date3.length);
    		var next_slash = without_resource.indexOf("/");
    		var datefin3 = without_resource.substring(0, next_slash);
    		var date2 = enddate
    		var without_resource2 = date2
    		var next_slash2 = without_resource2.indexOf("/");
    		var datefin2 = without_resource2.substring(0, next_slash2);
    
    function initbox(){
    
    if (((dt1 <= datefin2)&&(dt2 < datefin3))||(dt1 < datefin2)){
                       
                       if (!dom&&!ie&&!ns4)
                       return
                       crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
                       scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
                       crossobj.top=scroll_top-250+calunits
                       crossobj.visibility=(dom||ie)? "visible" : "show"
                       dropstart=setInterval("dropin()",50)
                       }
    }
    
    function dropin(){
    scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
    if (parseInt(crossobj.top)<100+scroll_top)
    crossobj.top=parseInt(crossobj.top)+40+calunits
    else{
    clearInterval(dropstart)
    bouncestart=setInterval("bouncein()",50)
    }
    }
    
    function bouncein(){
    crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
    if (bouncelimit<0)
    bouncelimit+=8
    bouncelimit=bouncelimit*-1
    if (bouncelimit==0){
    clearInterval(bouncestart)
    }
    }
    
    function dismissbox(){
    if (window.bouncestart) clearInterval(bouncestart)
    crossobj.visibility="hidden"
    }
    
    function truebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }
    
    
    window.onload=initbox
    
    </script>
    </head>
    
    <body>
    
    <div id="dropin" style="position:absolute;visibility:hidden;left:200px;top:100px;width:500px;height:300px;background-color:#F5F5F5">
    
    <div align="right"><a href="#" onClick="dismissbox();return false">[Close Box] </a></div>
    
    SPECIFY YOUR CONTENT HERE. IT COULD BE TEXT, IMAGES, OR RICH HTML
    
    </div>
    </body>
    
    </html>
    Last edited by Nate_Bro; 11-24-2004 at 05:31 AM.

  6. #6
    Join Date
    Nov 2004
    Location
    Texas
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This is perfect. I beleive this will work.

    Is there a way to set the start date too?

    Thanks so much.

    Have a great Turkey Day!

  7. #7
    Join Date
    Sep 2004
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    lol, thanks........

    and yes there is, lol

    my first go at it had a start date but when i rewrote it to make it smaller i left it out, but ya, I'll do that too

  8. #8
    Join Date
    Sep 2004
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry that its taking so long, but i just got back and i might have it done tomarow

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
  •