H
H
halfhope2019-01-11 02:34:33
MySQL
halfhope, 2019-01-11 02:34:33

How to set a fixed-adaptive block height?

Hello!
Site https://bit.ly/2Qyl3Il There is a slider on the main page of the site. Before JS initialization, they have a size of 0px, after initialization, the sizes are recalculated and the page is redrawn. The task is to avoid recalculation of sizes and redraws. Those. if I give the slider block a fixed height:

<div id="mmr-owl" class="owl-carousel" style="height:<?php echo $height ?>px;">

then the problem is partially solved. There is no recalculation, no redrawing. But the template is adaptive and on mobile the height remains the same (there is an indent from below). Is it possible to set a fixed responsive block height using CSS? Tried minmax, calc, vw, but it doesn't work.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Rublev, 2016-04-13
@Meller008

That's what I needed! Thanks everyone!
query="insert into `order`(ByerId,Price) select id,%s from byer where Name=%s"
cursor.execute(query, (Price,Name))

D
Dmitry Eremin, 2016-04-13
@EreminD

INSERT INTO oreder(ProviderId, Price) VALUES(_providerId, _price)

_providerId and _price to be replaced with the corresponding values

S
Sergey delphinpro, 2019-01-11
@halfhope

The method suggested by SmthTo is good when all slides are the same.
If the slides have a different number of heights and auto-adjust the height when changing the slide, it will not work.
I'll add another one that I use.
It is primitive: we just set the height of the wrapper for an uninitialized slider:

.myslider:not(.owl-loaded) {
  height: 300px;
  overflow-y: scroll;
}

Clearly, in this way it will not be possible to accurately indicate the desired height (or you will have to get very confused), but this, in general, is not necessary. When the height changes by just a few pixels after initialization, it's hardly noticeable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question