Last change
on this file since 583 was
568,
checked in by gav, 14 years ago
|
JavaScript? util improvements, added toggleWithEffectUtil() and useDiv option to toggleControl taglib.
|
File size:
1.0 KB
|
Line | |
---|
1 | |
---|
2 | function toggleUtil(id) { |
---|
3 | $(id).toggle(); |
---|
4 | } |
---|
5 | |
---|
6 | function toggleWithImgUtil(id, imageId, openImgUrl, closedImgUrl) { |
---|
7 | |
---|
8 | $(id).toggle(); |
---|
9 | |
---|
10 | if( $(id).visible() ) { |
---|
11 | $(imageId).src= openImgUrl; |
---|
12 | } |
---|
13 | else { |
---|
14 | $(imageId).src= closedImgUrl; |
---|
15 | } |
---|
16 | } |
---|
17 | |
---|
18 | function showUtil(id) { |
---|
19 | Effect.Appear(id,{duration:0.4,queue:'end'}); |
---|
20 | } |
---|
21 | |
---|
22 | function hideUtil(id) { |
---|
23 | Effect.Fade(id,{duration:0.4,queue:'end'}); |
---|
24 | } |
---|
25 | |
---|
26 | function toggleWithEffectUtil(id) { |
---|
27 | if( $(id).visible() ) { |
---|
28 | Effect.Fade(id,{duration:0.4,queue:'end'}); |
---|
29 | } |
---|
30 | else { |
---|
31 | Effect.Appear(id,{duration:0.4,queue:'end'}); |
---|
32 | } |
---|
33 | } |
---|
34 | |
---|
35 | function toggleWithImgAndEffectUtil(id, imageId, openImgUrl, closedImgUrl) { |
---|
36 | |
---|
37 | if( $(id).visible() ) { |
---|
38 | Effect.Fade(id,{duration:0.4,queue:'end'}); |
---|
39 | $(imageId).src= closedImgUrl; |
---|
40 | } |
---|
41 | else { |
---|
42 | Effect.Appear(id,{duration:0.4,queue:'end'}); |
---|
43 | $(imageId).src= openImgUrl; |
---|
44 | } |
---|
45 | } |
---|
46 | |
---|
47 | function textAreaScrollBottom(id) { |
---|
48 | $(id).scrollTop = $(id).scrollHeight; |
---|
49 | } |
---|
50 | |
---|
51 | function focusUtil(id) { |
---|
52 | $(id).focus(); |
---|
53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.