M
M
mr_blond972016-01-29 04:56:39
JavaScript
mr_blond97, 2016-01-29 04:56:39

How to get browser window height in javascript?

You need to make a slider with a height equal to the width of the screen. I make layout on joomla, I tried a bunch of sliders for joomla, none of them fit. I am satisfied with the standard bootstrap 2 slider, I decided to add it to the page. In order to change the height of the slider, there is a jQuery script:

<script type="text/javascript">
        $(
            function ()
            {
                $('.carousel').carousel({interval: 4000, pause: 'none'});

                setInterval(
                    function ()
                    {
                        var window_height = $(window).height();
                        $('#myCarousel').height(window_height);
                    }, 250
                );
            }
        );
</script>


The code does not work without the bootstrap.min.js library When this library is included, the code works, but the menu in Joomla starts to work poorly, so the question is how to do the same without JQuery in Javascript?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stalker_RED, 2016-01-29
@Stalker_RED

Screen sizes, window sizes, viewports, and so on: www.quirksmode.org/mobile/viewports.html
there is also the second part.

E
Egor T, 2016-01-29
@Nengchak

Tyk

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question