Welcome Guest. Please Login or Register  


You are here: Index > Softaculous Auto Installer > General Support > Topic : initial load collapsed



Normal Mode | Print  

initial load collapsed
columbusgeek
Group: Member
Post Group: Newbie
Posts: 6
Status:
My javascript skills are rather poor.  can you please explain what might need changed in this file?

Code

//////////////////////////////////////////////////////////////
// js_slider
// By Alons
// Please Read the Terms of use at http://www.softaculous.com
// (c)Softaculous Inc.
//////////////////////////////////////////////////////////////

function slideitout(elid, endheight, inc, time){
    startheight = $(elid).offsetHeight + inc;
    if(startheight < endheight){
        diff = endheight - startheight;
        if(diff > inc){
            $(elid).style.height = startheight+"px";
            setTimeout('slideitout(\''+elid+'\', '+endheight+', '+inc+', '+time+');', time);
        }else{
            $(elid).style.height = endheight+"px";
        }
    }
};

function pullitin(elid, dec, time){
    height = $(elid).offsetHeight - dec;
    if(height > dec){
        $(elid).style.height = height+"px";
        setTimeout('pullitin(\''+elid+'\', '+dec+', '+time+');', time);
    }else{
        $(elid).style.height = "1px";//A bug in IE 5.5
    }
};

function slider(){
    this.speed = 20;
    this.img_collapsed = imgurl+'collapsed.gif';
    this.img_expanded = imgurl+'expanded.gif';
    this.elements = new Array();
   
    this.slide = function(id){
        var height = $(id).offsetHeight;
        if(height > 1){
            this.collapse(id);
        }else{
            this.expand(id);
        }
    };
   
    this.expand = function(id){
        slideitout(id, $('t'+id).offsetHeight, this.speed, 1);
        $('i'+id).src = this.img_expanded;
        removecookie(id);
    };
   
    this.collapse = function(id){
        pullitin(id, this.speed, 1);
        $('i'+id).src = this.img_collapsed;
        setcookie(id, '1', 365);
    };
   
    //Init it
    this.init = function(){   
        var elements = this.elements;
        for(id in elements){
            if(getcookie(elements[id]) == 1){
                $(elements[id]).style.height = "1px";
                $('i'+elements[id]).src = this.img_collapsed;
            }
        }
    };
   
    this.expandAll = function(){
        var elements = this.elements;
        for(key in elements){
            id = elements[key];
            this.expand(id);
        }
    };
   
    this.collapseAll = function(){
        var elements = this.elements;
        for(key in elements){
            id = elements[key];
            this.collapse(id);
        }
    };
};

IP: --   


Threads
 columbusgeek   initial load collapsed, how can I do this? (2 Replies, Read 3840 times)
    |--  alons   Hi, Its controlled...   on December 22, 2009, 11:01 am
    |--  columbusgeek   My javascript skills...   on December 22, 2009, 3:38 pm

« Previous    Next »

Normal Mode | Print  



Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is May 19, 2025, 8:40 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.028