Any way to add shadow to images in jssor slider?

I used Jssor to create a slider / slideshow. I would ideally want a shadow to appear under each image. I added a shadow to my img style, but the shadow appears only on some images and even then, only on one side. I also tried to add a border, but the thing only appears on three sides (the missing edge depends on whether the image is portrait or landscape). If I create my tag, of course, the thumbnails will also get the style, and they all have similar problems displaying the shadow.

here is css (apologies if i dont use it correctly, im new here!)

img {
    padding:0px;
    margin:0px;
    border:medium solid black;
    box-shadow: 10px 10px 5px #888;
}

TIA Rob

+4
source share
2 answers
<style>
    .shadow {
        padding:0px;
        margin:0px;
        border:medium solid black;
        box-shadow: 10px 10px 5px #888;
    }

</style>


<script>

    jQuery(document).ready(function ($) {
        var options = {
            $AutoPlay: true,
            $DragOrientation: 3
        };

        var jssor_slider1 = new $JssorSlider$("slider1_container", options);

        //you can add shadow for outer container after jssor slider initialized.
        $("slider1_container").addClass("shadow");
        //or you can add shadow for slides container
        //$("slides1_container").addClass("shadow");
    });
</script>


<div id="slider1_container" style="position: relative; top: 0px; left: 0px; width: 600px; height: 300px;">
    <!-- Slides Container -->
    <div id="slides1_container" u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 600px; height: 300px;
        overflow: hidden;">
        ...
    </div>
</div>
0
source

you can leave the style on the images, but only large ones, for example, # Edited to make a shadow image around the circle

img[width="150"]{
    padding:0px;
    margin:10px;
    border:medium solid black;
    box-shadow: 10px 10px 5px #888, -10px -10px 5px #888,-10px 10px 5px #888, 10px -10px 5px #888;
}
<img width="150" height="150" src="http://lorempixel.com/200/200/sports/1"/>
<img width="150" height="150" src="http://lorempixel.com/200/200/sports/1"/>
<img width="150" height="150" src="http://lorempixel.com/200/200/sports/1"/>
<img width="60" height="60" src="http://lorempixel.com/200/200/sports/1"/>
<img width="60" height="60" src="http://lorempixel.com/200/200/sports/1"/>
<img width="60" height="60" src="http://lorempixel.com/200/200/sports/1"/>
Run codeHide result
0
source

Source: https://habr.com/ru/post/1569743/


All Articles