Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F948555
test_SizingPane.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
test_SizingPane.html
View Options
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<
html
>
<
head
>
<
title
>
dojox.layout.SizingPane
</
title
>
<
script
type
=
"text/javascript"
src
=
"../../../dojo/dojo.js"
></
script
>
<
script
type
=
"text/javascript"
>
dojo
.
require
(
"dijit.dijit"
);
dojo
.
require
(
"dojo.fx"
);
</
script
>
<
style
type
=
"text/css"
>
@
import
"../../../dojo/resources/dojo.css"
;
@
import
"../../../dijit/themes/dijit.css"
;
@
import
"../../../dijit/themes/tundra/tundra.css"
;
@
import
"../../../dijit/tests/css/dijitTests.css"
;
body
{
background
:
#ededed
;
color
:
#666
;
}
#
nav
{
position
:
absolute
;
top
:
100
px
;
left
:
10
px
;
width
:
200
px
;
-moz-
border-radius
:
8
pt
8
pt
;
background
:
#fff
;
border
:
2
px
solid
#ccc
;
}
#
box1
{
overflow
:
hidden
;
position
:
absolute
;
display
:
block
;
width
:
25
px
;
height
:
25
px
;
-moz-
border-radius
:
8
pt
8
pt
;
radius
:
8
pt
;
-webkit-
border-radius
:
8
pt
8
pt
;
background
:
#fff
;
border
:
2
px
solid
#ccc
;
padding
:
7
px
;
}
</
style
>
<
script
>
var
animationMethod
=
"chain"
;
// || combine
var
_showing
=
false
;
var
animG
,
offsetW
,
offsetH
=
null
;
var
box1
=
null
;
var
boxMixin
=
{
startWidth
:
25
,
startHeight
:
25
,
endWidth
:
320
,
endHeight
:
320
,
duration
:
300
};
dojo
.
addOnLoad
(
function
()
{
box1
=
dojo
.
byId
(
'box1'
);
centerNode
(
box1
);
dojo
.
connect
(
box1
,
"onmouseover"
,
null
,
"show"
);
dojo
.
connect
(
box1
,
"onmouseout"
,
null
,
"hideCheck"
);
//dojo.connect(box1,"onmouseout",null,"hideCheck");
//dojo.connect(but1,"onclick",null,"show");
});
function
hideCheck
(
node
)
{
if
(
_showing
)
{
setTimeout
(
"hide('box1')"
,
125
);
}
}
function
centerNode
(
node
)
{
var
viewport
=
dijit
.
getViewport
();
var
mb
=
dojo
.
marginBox
(
node
);
var
style
=
node
.
style
;
offsetW
=
mb
.
w
-
style
.
width
;
offsetH
=
mb
.
h
-
style
.
height
;
style
.
left
=
(
viewport
.
l
+
(
viewport
.
w
-
mb
.
w
)
/
2
)
+
"px"
;
style
.
top
=
(
viewport
.
t
+
(
viewport
.
h
-
mb
.
h
)
/
2
)
+
"px"
;
}
function
doUnderlay
()
{
console
.
debug
(
'make underlay'
);
}
function
show
()
{
if
(
_showing
)
{
return
;
}
if
(
animG
&&
animG
.
status
==
"playing"
)
{
animG
.
stop
();
}
_showing
=
true
;
var
viewport
=
dijit
.
getViewport
();
var
newLeft
=
(
viewport
.
l
+
(
viewport
.
w
-
boxMixin
.
endWidth
)
/
2
);
var
newTop
=
(
viewport
.
t
+
(
viewport
.
h
-
boxMixin
.
endHeight
)
/
2
);
var
style
=
box1
.
style
;
var
anim1
=
dojo
.
animateProperty
({
node
:
box1
,
duration
:
boxMixin
.
duration
/
2
,
properties
:
{
width
:
{
/* start: boxMixin.startWidth, */
end
:
boxMixin
.
endWidth
,
unit
:
"px"
},
left
:
{
end
:
newLeft
,
unit
:
"px"
}
},
beforeBegin
:
doUnderlay
()
});
var
anim2
=
dojo
.
animateProperty
({
node
:
box1
,
duration
:
boxMixin
.
duration
/
2
,
properties
:
{
height
:
{
/*start: boxMixin.startHeight, */
end
:
boxMixin
.
endHeight
,
unit
:
"px"
},
top
:
{
end
:
newTop
,
unit
:
"px"
}
},
onEnd
:
function
()
{
_showing
=
true
;
}
});
animG
=
dojo
.
fx
[
animationMethod
]([
anim1
,
anim2
]).
play
();
// chain:
// animate width / left position
// animate height / top position
// onend: fadeIn content?
}
function
hide
(
node
)
{
if
(
!
_showing
)
return
;
if
(
animG
&&
animG
.
status
()
==
"playing"
)
{
animG
.
stop
();
}
var
viewport
=
dijit
.
getViewport
();
var
newLeft
=
(
viewport
.
l
+
(
viewport
.
w
-
boxMixin
.
startWidth
)
/
2
);
var
newTop
=
(
viewport
.
t
+
(
viewport
.
h
-
boxMixin
.
startHeight
)
/
2
);
var
style
=
node
.
style
;
var
anim1
=
dojo
.
animateProperty
({
node
:
box1
,
duration
:
boxMixin
.
duration
/
2
,
properties
:
{
width
:
{
end
:
boxMixin
.
startWidth
,
unit
:
"px"
},
left
:
{
end
:
newLeft
,
unit
:
"px"
}
}
});
var
anim2
=
dojo
.
animateProperty
({
node
:
box1
,
duration
:
boxMixin
.
duration
/
2
,
properties
:
{
height
:
{
end
:
boxMixin
.
startHeight
,
unit
:
"px"
},
top
:
{
end
:
newTop
,
unit
:
"px"
}
},
onEnd
:
function
()
{
_showing
=
false
;
}
});
// if we chain, do anim2 first [because height/top is how anim2 in show() ends]
animG
=
dojo
.
fx
[
animationMethod
]([
anim2
,
anim1
]).
play
();
}
</
script
>
</
head
>
<
body
class
=
"tundra"
>
<
h1
class
=
"testTitle"
>
dojox.layout.SizingPane
</
h1
>
<
p
>
This is simply a test / example. There is no
<
i
>
real
</
i
>
dojox.layout.SizingPane, but this code
should/might become part of a dojox.fx.toggle class ... it's just "neat", isn't it?
</
p
>
<
div
id
=
"box1"
>
lorem. lorem. lorem.
</
div
>
</
body
>
</
html
>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Sat, Apr 26, 17:40 (22 h, 5 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27111
Default Alt Text
test_SizingPane.html (4 KB)
Attached To
rZED Zed
Event Timeline
Log In to Comment