root / cloudcms / static / cloudcms / js / common.js @ 8dd49103
History | View | Annotate | Download (1.9 kB)
1 |
function setContainerMinHeight(){ |
---|---|
2 |
|
3 |
var h = $('.header').height(); |
4 |
var f = $('.footer').height(); |
5 |
var w = $(window).height(); |
6 |
var pTop = parseInt (($('.container .wrapper').css('padding-top').replace("px", "")) ); |
7 |
var pBottom = parseInt (($('.container .wrapper').css('padding-bottom').replace("px", ""))); |
8 |
|
9 |
var c = w - ( h+f+pTop+pBottom);
|
10 |
$('.container .wrapper').css('min-height', c); |
11 |
|
12 |
|
13 |
} |
14 |
|
15 |
$(document).ready(function() { |
16 |
|
17 |
setContainerMinHeight(); |
18 |
|
19 |
$('.show-extra').click(function(e) { |
20 |
e.preventDefault(); |
21 |
|
22 |
$(this).parents('.bg-wrap').find('.extra').toggle('slow'); |
23 |
$('.hide-extra').toggle(); |
24 |
}); |
25 |
$('.hide-extra').click(function(e) { |
26 |
e.preventDefault(); |
27 |
$(this).hide(); |
28 |
$(this).parents('.bg-wrap').find('.extra').hide('slow'); |
29 |
}); |
30 |
|
31 |
$('.box-more p').click(function(e) { |
32 |
$(this).siblings('.clearfix').toggle('slow'); |
33 |
$(this).parents('.box-more').toggleClass('border'); |
34 |
}); |
35 |
|
36 |
|
37 |
$('.top-msg a.close').click(function(e) { |
38 |
e.preventDefault(); |
39 |
$(this).parents('.top-msg').slideUp('5000', function() { |
40 |
$('.top-msg').removeClass('active') |
41 |
}); |
42 |
}); |
43 |
|
44 |
//$('select').dropkick();
|
45 |
|
46 |
|
47 |
if ( $('#os').length > 0 ) { |
48 |
var os = BrowserDetect.OS;
|
49 |
if ( os!=="an unknown OS" ) { |
50 |
$('#os').html('version '+os); |
51 |
} |
52 |
} |
53 |
|
54 |
$('.top-msg .success').parents('.top-msg').css( |
55 |
{ |
56 |
backgroundColor: '#f3c', |
57 |
color: '#fff' |
58 |
} |
59 |
) |
60 |
|
61 |
$('.top-msg .error').parents('.top-msg').css( |
62 |
{ |
63 |
backgroundColor: 'red', |
64 |
color: '#fff' |
65 |
} |
66 |
) |
67 |
|
68 |
|
69 |
$('.top-msg .warning').parents('.top-msg').css( |
70 |
{ |
71 |
backgroundColor: '#90f', |
72 |
color: '#fff' |
73 |
} |
74 |
) |
75 |
|
76 |
}); |