www.webdeveloper.com
Results 1 to 3 of 3

Thread: How can this be done?

  1. #1
    Join Date
    Dec 2005
    Posts
    194

    How can this be done?

    Hey guys just wondering how this guy at this site dailysnap.com did what he did. On the top he has a + sign and you click it and a menu comes done. Is there any free scripts that I can use that does this?


    thanks

    adam

  2. #2
    Join Date
    Dec 2005
    Posts
    194
    Can anybody help me?

  3. #3
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,684
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    <!--
    // by Vic Phillips (28-Jan-2005) http://www.vicsjavascripts.org.uk
    
    // Application Notes
    // Executed by event call to zxcCngHeight(zxcobj,zxcdir,zxcminh,zxcdly)
    // where
    // parameter 0 = object or object ID name               (object or string)
    // parameter 1 = < 1 reduce height, > 1 increase height (digits)
    // parameter 2 = the minimum height                     (digits)
    // parameter 3 = the maximum height                     (digits)
    // parameter 4 = (optional) delay (default 100mSec)       (digits)
    // parameter 5 = (optional) true = remove element when at minimim height (true or null)
    
    // Note: parameters 2,3 and 5 cannot be changed after the first element call
    
    // Functional Code NO NEED to Change
    
    var zxcOOPCnt=0
    
    function zxcCngHeight(zxcobj,zxcdir,zxcminh,zxcmaxh,zxcdly,zxcrmv){
     if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj);}
     if (!zxcobj.oopch){ zxcobj.oopch=new zxcOOPCngHeight(zxcobj,zxcdir,zxcminh,zxcmaxh,zxcdly,zxcrmv); }
     clearTimeout(zxcobj.oopch.to);
     zxcobj.oopch.dir=zxcdir;
     zxcobj.oopch.delay=zxcdly||zxcobj.oopch.delay;
     if (zxcdir>0){ zxcobj.style.display=''; }
     zxcobj.oopch.cngheight();
    }
    
    function zxcOOPCngHeight(zxcm,zxcdir,zxcminh,zxcmaxh,zxcdly,zxcrmv){
     this.obj=zxcm.style;
     this.obj.position='relative';
     this.obj.overflow='hidden';
     this.ref='zxchs'+zxcOOPCnt;
     window[this.ref]=this;
     this.minh=zxcminh;
     this.maxh=zxcmaxh;
     this.rmv=zxcrmv;
     this.dir=zxcdir;
     if (zxcdir<0){ this.cnt=this.maxh; }
     else { this.cnt=this.minh; }
     this.delay=zxcdly||100;
     this.to=null;
     zxcOOPCnt++;
    }
    
    zxcOOPCngHeight.prototype.cngheight=function(){
     if ((this.dir<0&&this.cnt-this.dir>=this.minh)||(this.dir>0&&this.cnt+this.dir<=this.maxh)){
      this.obj.height=(this.cnt+=this.dir)+'px';
      this.setTimeOut("cngheight();",this.delay);
     }
     else if (this.dir<0){ this.obj.height=this.minh+'px'; if (this.rmv){ this.obj.display='none'; } }
     else if (this.dir>0){ this.obj.height=this.maxh+'px'; }
    
    }
    
    zxcOOPCngHeight.prototype.setTimeOut=function(zxcf,zxcd){
     this.to=setTimeout("window."+this.ref+"."+zxcf,zxcd);
    }
    
    
    //-->
    </script>
    </head>
    
    <body>
    <table width="150" border="1">
    <tbody   >
     <tr >
      <td align="center" >
      <img src="http://www.vicsjavascripts.org.uk/StdImages/Up1.gif" onclick="zxcCngHeight('Row2',-1,20,100,5,true);" >
      <img src="http://www.vicsjavascripts.org.uk/StdImages/Down1.gif" onclick="zxcCngHeight('Row2',1,20,100,5,true);" >
      </td>
     </tr>
     <tr height=100 id="Row2" onclick="zxcCngHeight(this,-1,20);" style="display:none;" >
      <td>1111111111111111</td>
     </tr>
     <tr >
      <td align="center" >
      <img src="http://www.vicsjavascripts.org.uk/StdImages/Up1.gif" onclick="zxcCngHeight('Row3',-1,20,100,100);" >
      <img src="http://www.vicsjavascripts.org.uk/StdImages/Down1.gif" onclick="zxcCngHeight('Row3',1,20,100,10);" >
      </td>
     </tr>
     <tr height=100 id="Row3" >
      <td>1111111111111111</td>
     </tr>
    </tbody>
    
    </table>
    </body>
    
    </html>
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles