layerslider WP 100% width and height

Can someone please guide me how to get an image full screen so that it stays in the centre both horizontal and vertical like the link provided.

http://css-tricks.com/examples/FullPageBackgroundImage/progressive.php

Read More

I’m only after the background bit and i need the image in a div apposed to in the css like in the example as i am using it for a slider in wordpress.

Related posts

Leave a Reply

2 comments

  1. In order to make your LayerSlider display at 100% height and width, leave the “Slider height” attribute in “Slider Settings” blank, and then use a script like the following to set the height:

    <script type="text/javascript"> 
        function resize()
        {
            var heights = window.innerHeight;
            document.getElementById("layerslider_1").style.height = heights + "px";
        }
        resize();
        window.onresize = function() {
            resize();
        };
    </script>
    

    Insert the script into your footer.php file before the closing body tag. If your slider ID isn’t number 1, then change “layerslider_1” to the correct ID.

  2. you can add style to the div element

    <div style="background: url(images/xyz.jpg) no-repeat center center fixed;">...</div> 
    

    I just took the css from your sample page and copy/pasted!