1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MonoRail
.Framework
.Helpers
20 /// Exposes the effect script from Thomas Fuchs
21 /// (http://script.aculo.us, http://mir.aculo.us)
24 /// Before using it, you must install the scripts. See <see cref="ScriptaculousHelper.InstallScripts"/>
26 [Obsolete("Use ScriptaculousHelper instead")]
27 public class Effects2Helper
: ScriptaculousHelper
30 /// Make an element appear. If the element was previously set to display:none;
31 /// inside the style attribute of the element, the effect will automatically
35 /// Microsoft Internet Explorer can only set opacity on elements that have a
36 /// 'layout'. To let an element have a layout, you must set some CSS
37 /// positional properties, like 'width' or 'height'.
39 /// <param name="elementId"></param>
40 /// <returns></returns>
41 public String
Appear(String elementId
)
43 return ScriptBlock( String
.Format( "new Effect.Appear('{0}');", elementId
) );
47 /// Makes an element fade away and takes it out of the document flow
48 /// at the end of the effect by setting the CSS display property to false.
51 /// Works safely with most HTML block elements (like DIV and LI).
52 /// Microsoft Internet Explorer can only set opacity on elements that
53 /// have a 'layout'. To let an element have a layout, you must set some
54 /// CSS positional properties, like 'width' or 'height'.
56 /// <param name="elementId"></param>
57 /// <returns></returns>
58 public String
Fade(String elementId
)
60 return ScriptBlock( String
.Format( "new Effect.Fade('{0}');", elementId
) );
64 /// Gives the illusion of the element puffing away (like a in a cloud of smoke).
67 /// Works safely with most HTML block elements (like DIV and LI).
69 /// <param name="elementId"></param>
70 /// <returns></returns>
71 public String
Puff(String elementId
)
73 return ScriptBlock( String
.Format( "new Effect.Puff('{0}');", elementId
) );
77 /// Makes the element drop and fade out at the same time.
80 /// Works safely with most HTML block elements (like DIV and LI).
82 /// <param name="elementId"></param>
83 /// <returns></returns>
84 public String
DropOut(String elementId
)
86 return ScriptBlock( String
.Format( "new Effect.DropOut('{0}');", elementId
) );
90 /// Moves the element slightly to the left, then to the right, repeatedly.
93 /// Works safely with most HTML block elements (like DIV and LI).
95 /// <param name="elementId"></param>
96 /// <returns></returns>
97 public String
Shake(String elementId
)
99 return ScriptBlock( String
.Format( "new Effect.Shake('{0}');", elementId
) );
103 /// Gives the illusion of a TV-style switch off.
106 /// Works safely with most HTML block elements (like DIV and LI).
108 /// <param name="elementId"></param>
109 /// <returns></returns>
110 public String
SwitchOff(String elementId
)
112 return ScriptBlock( String
.Format( "new Effect.SwitchOff('{0}');", elementId
) );
116 /// This pair of effects simulates a window blind, where the
117 /// contents of the affected elements stay in place.
120 /// Works safely with most HTML block elements (like DIV and LI),
121 /// except table rows, table bodies and table heads.
123 /// <param name="elementId"></param>
124 /// <returns></returns>
125 public String
BlindUp(String elementId
)
127 return ScriptBlock( String
.Format( "new Effect.BlindUp('{0}');", elementId
) );
131 /// This pair of effects simulates a window blind, where the
132 /// contents of the affected elements stay in place.
135 /// Works safely with most HTML block elements (like DIV and LI),
136 /// except table rows, table bodies and table heads.
138 /// <param name="elementId"></param>
139 /// <returns></returns>
140 public String
BlindDown(String elementId
)
142 return ScriptBlock( String
.Format( "new Effect.BlindDown('{0}');", elementId
) );
146 /// This pair of effects simulates a window blind, where the contents of
147 /// the affected elements scroll up and down accordingly.
150 /// You must include a second DIV element,
151 /// wrapping the contents of the outer DIV.
152 /// So, if you call new Effect.SlideDown('x'), your element must look like this:
154 /// <div id="x"><div>contents</div></div>
156 /// Because of a bug in Internet Explorer 6 (overflow not correctly hidden),
157 /// an additional wrapper div is needed if you want to use these effects on
158 /// absolutely positionend elements (wrapper is the absolutely positioned element,
159 /// x has position:relative; set; ):
161 /// <div id="wrapper">
162 /// <div id="x"><div>contents</div></div>
165 /// Works only on block elements.
167 /// <param name="elementId"></param>
168 /// <returns></returns>
169 public String
SlideUp(String elementId
)
171 return ScriptBlock( String
.Format( "new Effect.SlideUp('{0}');", elementId
) );
175 /// This pair of effects simulates a window blind, where the contents of
176 /// the affected elements scroll up and down accordingly.
179 /// You must include a second DIV element,
180 /// wrapping the contents of the outer DIV.
181 /// So, if you call new Effect.SlideDown('x'), your element must look like this:
183 /// <div id="x"><div>contents</div></div>
185 /// Because of a bug in Internet Explorer 6 (overflow not correctly hidden),
186 /// an additional wrapper div is needed if you want to use these effects on
187 /// absolutely positionend elements (wrapper is the absolutely positioned element,
188 /// x has position:relative; set; ):
190 /// <div id="wrapper">
191 /// <div id="x"><div>contents</div></div>
194 /// Works only on block elements.
196 /// <param name="elementId"></param>
197 /// <returns></returns>
198 public String
SlideDown(String elementId
)
200 return ScriptBlock( String
.Format( "new Effect.SlideDown('{0}');", elementId
) );