Commit 3670604529770f5a23bd059782793e8c879f3dc7
1 parent
0cdfad3f
Веталь
Showing
2 changed files
with
34 additions
and
1 deletions
Show diff stats
frontend/views/layouts/main.php
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | $('#call').call({token:'" . Yii::$app->request->getCsrfToken () . "'}); | 29 | $('#call').call({token:'" . Yii::$app->request->getCsrfToken () . "'}); |
30 | ", View::POS_READY, 'call'); | 30 | ", View::POS_READY, 'call'); |
31 | 31 | ||
32 | -$this->registerJsFile (Yii::$app->request->baseUrl . '/js/fix_height.js', ['position' => View::POS_HEAD]); | 32 | +$this->registerJsFile (Yii::$app->request->baseUrl . '/js/fix_height.js', ['position' => View::POS_HEAD, 'depends' => ['yii\web\JqueryAsset']]); |
33 | $this->registerJs (" | 33 | $this->registerJs (" |
34 | var activeTab = $('.social li:first a').attr('id'); | 34 | var activeTab = $('.social li:first a').attr('id'); |
35 | $('.'+activeTab+'_box').show(); | 35 | $('.'+activeTab+'_box').show(); |
frontend/web/js/fix_height.js
1 | +$(document).ready(function(){ | ||
2 | + autoHeight(); | ||
3 | + function autoHeight() { | ||
4 | + | ||
5 | + footerBottom(); | ||
6 | + resizeFooterBottom(); | ||
7 | + | ||
8 | + function footerBottom(){ | ||
9 | + var heightHeader1 = $('nav.top').height() | ||
10 | + var heightHeader2 = $('.section-box-header').height() | ||
11 | + var heightHeader3 = $('.menu').height() | ||
12 | + var heightHeader = heightHeader1+heightHeader2+heightHeader3 | ||
13 | + var heightFooter1 = $('.bottom').height() | ||
14 | + var heightFooter2 = $('.fotter').height() | ||
15 | + var heightFooter = heightFooter1+heightFooter2 | ||
16 | + var windowHeight = $(window).height() | ||
17 | + $('.wrapper_all').css({minHeight:windowHeight-heightHeader-heightFooter}) | ||
18 | + } | ||
19 | + | ||
20 | + function resizeFooterBottom(){ | ||
21 | + $(window).resize(function(){ | ||
22 | + footerBottom(); | ||
23 | + }) | ||
24 | + } | ||
25 | + } | ||
26 | +}) | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + |