Hi there,

I just started developing a class for creating a layout and need some
input.

What i intend ending up with is to be able to create a layout with an
top, left, center, right and bottom div like this :

<div id="box-container">
    <div id="box-top"></div>
    <div id="box-left"></div>
    <div id="box-center"></div>
    <div id="box-right"></div>
    <div id="bottom"></div>
</div>

To generate this i would like to be able to somthing like this :

window.addEvent('domready', function(){
    var layout = new ND.Layout({
        elm: 'box-container',
        boxs: [
            {position: 'top'},
            {position: 'left'},
            {position: 'center'},
            {position: 'right'},
            {position: 'bottom'}
        ]
    });
});

Now in my class i have this :

ND.Layout = new Class({
    Implements: [Options, Events],

    options:{
        elm: '',
        boxs: []
    },

    initialize: function(options){
        this.setOptions(options)
        ...more code...
    }

    ...more functions...
});

For each items in the boxs array i would end up with a few variables
like position, width, height, resizable ect. and now for my question
where should i define these ?

A. in the boxs array
B. in an external object
C. in another class

Or don't i need to define them at all ?

Reply via email to