L
L
Leonid2020-04-23 19:06:29
css
Leonid, 2020-04-23 19:06:29

Implement adaptability in self-written image slider?

There is a small self-written JQuery slider with two twists:

<div class="slider">
  <div>
    <img src="1.jpg">
    <img src="2.jpg">
    <img src="3.jpg">
  </div>
  <a class="prev"></a>
  <a class="next"></a>
</div>

.slider {
  float: right;
  max-width: 712px;
  max-height: 423px;
  overflow: hidden;
  position: relative;
}
.slider div {
  position:relative;
        width: 10000px;
    height: 424px;
}
.slider div img {
  float: left;
  display: block;
  width: 100%;
  max-width: 712px;
}


It is necessary to implement adaptability for it, namely: so that the images inside the divs are no more than the width of the parent .slider

What are the options?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Zaletsky, 2020-04-23
@JZ_52

The simplest example, it seems to me, is through a pseudo-class.

A
akopniko12, 2020-04-24
@akopniko12

Set an event to resize the window. Then take the width of the screen and change it for the pictures.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question