source: trunk/web-app/js/jsUtil.js @ 338

Last change on this file since 338 was 323, checked in by gav, 15 years ago

Add toggleWithImgAndEffect to JsUtil.
Replace control divs with our new JsUtil toggleControl taglib.
Small CSS adjustment to asset tree pane close.

File size: 730 bytes
Line 
1
2function toggleUtil(id) {
3    $(id).toggle();
4}
5
6function 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
18function showUtil(id) {
19    Effect.Appear(id,{duration:0.4,queue:'end'});
20}
21
22function hideUtil(id) {
23    Effect.Fade(id,{duration:0.4,queue:'end'});
24}
25
26function toggleWithImgAndEffectUtil(id, imageId, openImgUrl, closedImgUrl) {
27
28    if( $(id).visible() ) {
29        Effect.Fade(id,{duration:0.4,queue:'end'});
30        $(imageId).src= closedImgUrl;
31    }
32    else {
33        Effect.Appear(id,{duration:0.4,queue:'end'});
34        $(imageId).src= openImgUrl;
35    }
36}
Note: See TracBrowser for help on using the repository browser.