PDA

View Full Version : - DHTML library - I don't understand these lines.


nanakorns
17.07.2001, 07:34
Please Help. I'm new to dhtml and I like this site verymuch.
------------------
if((bw.dom || bw.ie4) && this.css.clip) {
this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1);
this.c=this.c.split(' ');
for(var i=0;i<4;i++){this.c[i:cugv6k6xh9]=parseInt(this.c[i:cugv6k6xh9])}
}
this.ct=this.css.clip.top||this.c[0]||0;
this.cr=this.css.clip.right||this.c[1]||this.w||0
this.cb=this.css.clip.bottom||this.c[2]||this.h||0;
this.cl=this.css.clip.left||this.c[3]||0
---------------------------
anyone please explain. Thank you very much.

nanakorns
18.07.2001, 19:48
Thanks a lot, Mr.Ecsplosiv.
But what is 'slice()', 'split()'.

bratta
18.07.2001, 19:52
slice and split are methods to the String object. Slice is similar to substr, it slices the string, arguments: start,length

This:
test="hello you"
test = test.slice(0,5)
alert(test)

Will alert test, see? I slice the string..

Split makes the string into to an array, arguments: divider

This:

test="hello you"
test = test.split(" ")
with make test into an array with these values:
test[0] = "hello"
test[1] = "you"

Hope that helped.

-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com/

bratta
18.07.2001, 20:26
:)

-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com/

nanakorns
20.07.2001, 10:37
Thank you very much, Mr.Bratta and Mr.Ecsplosiv.
I know I really stupid.
Thanks again.