M
M
mrzgt2019-10-11 16:13:10
JavaScript
mrzgt, 2019-10-11 16:13:10

After refreshing the page, the function calculates the height incorrectly?

There is an owl carousel

$(document).ready(function() {
$('#carusel').owlCarousel({
<?php if ($autoplay_on) { ?>
autoplay:true,
autoplayTimeout:<?php echo $autoplay; ?>,
<?php if ($stophover) { ?>
autoplayHoverPause:true,
<?php } ?>
<?php } ?>
rewind:true,
<?php if ($navigation) { ?>
nav: true,
navText:  ['<i class="fa fa-chevron-left fa-5x"></i>', '<i class="fa fa-chevron-right fa-5x"></i>'],
<?php } ?>
autoplaySpeed: <?php echo $rew_speed; ?>,
onInitialized: OwlStageHeightSpecial,
onInitialize: OwlStageHeightSpecial,
 
onRefreshed : OwlStageHeightSpecial,

responsiveClass:true,
responsive:{
0:{
items:2,
},
768:{
items:3,
},
1024:{
items:4,
},
1200:{
items:<?php echo $items; ?>,
}
}
})

function OwlStageHeightSpecial(event) {
$('.carusel').css({'height': $('#carusel .owl-stage-outer').outerHeight() });
}

});

The problem is that after reloading the page, sometimes the OwlStageHeightSpecial function incorrectly calculates the height

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
skuvaWeb, 2019-10-11
@skuvaWeb

Скорее всего это из-за transiton на margin и padding. Уберите transition этих свойств у контейнера, должно помочь

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question