V
V
Vladimir Kuts2017-06-15 08:28:33
iPhone
Vladimir Kuts, 2017-06-15 08:28:33

Press the banner to the bottom?

There is a banner on top of the image which I push to the bottom of the viewable area like so:

document.getElementById('myBanner').style.top = $(window).height() - document.getElementById('myBanner').clientHeight + "px";

Everything is ok in the developer console - the banner is pressed as it should be, everything is fine on Android too, but in real life on the iPhone a bar with controls appears below, and when it disappears, a hole remains between the bottom of the display and the banner. How to press the same banner to the bottom edge?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Zhivagin, 2017-06-15
@Krasnodar_etc

In general, it's strange to do this in JS. Style is usually enough. An example on some codepen would be

Y
Yurii Vlasiuk, 2017-06-15
@forestyura

Maybe not quite right, but as an option to use positioning css
position:absolute;
bottom: 0px;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question