Slick Slider: animate first and last item in viewport2019 Community Moderator ElectionGet the last item in an arrayHow can I apply opacity when I am using cache?CSS inline-block not working in slider listCSS scale transformation on iOS Safari zooms page outHow to use two ease-in-out effects for two different css properties?slick slider on transition keep structureLoad an img src as a background image for the Div it resides in with jQuerySlick Slider how to change options?Change div size dynamically based on background-image aspect ratio and fixed heightSlick Slider: Scroll to last slide if slider is in viewport

“I had a flat in the centre of town, but I didn’t like living there, so …”

Can we carry rice to Japan?

Where is the fallacy here?

What could be a means to defeat a childrens’ nightmare?

When to use mean vs median

Why is it "take a leak?"

Giving a talk in my old university, how prominently should I tell students my salary?

How to kill a localhost:8080

Is there a math equivalent to the conditional ternary operator?

How do I deal with being envious of my own players?

PTIJ: Aharon, King of Egypt

How can I highlight parts in a screenshot

How to get the first element while continue streaming?

Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?

How to merge row in the first column in LaTeX

Lock enemy's y-axis when using Vector3.MoveTowards to follow the player

How do you say “my friend is throwing a party, do you wanna come?” in german

Every subset equal to original set?

Why did the Cray-1 have 8 parity bits per word?

What is the meaning of "notice to quit at once" and "Lotty points”

How to mitigate "bandwagon attacking" from players?

Create chunks from an array

Deal the cards to the players

When was drinking water recognized as crucial in marathon running?



Slick Slider: animate first and last item in viewport



2019 Community Moderator ElectionGet the last item in an arrayHow can I apply opacity when I am using cache?CSS inline-block not working in slider listCSS scale transformation on iOS Safari zooms page outHow to use two ease-in-out effects for two different css properties?slick slider on transition keep structureLoad an img src as a background image for the Div it resides in with jQuerySlick Slider how to change options?Change div size dynamically based on background-image aspect ratio and fixed heightSlick Slider: Scroll to last slide if slider is in viewport










0















I would like to fade-zoom in and out the last and first slide of a Slick slider. I managed to do so, but when the slider has the "infinite" setting it will remove all slide classes of "slick-active" when the loop has to start over. The problem is that the slider then zooms/fades out completely for a small period of time.



Can anyone help with keeping all slides visible but the first and last in viewport?



Thanks!



Codepen: https://codepen.io/thijs-webber/pen/drNYRo



<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="container">
<div class="references-slider">
<div class="slide">
<img src="http://lorempixel.com/250/250" alt="">
</div>
<div class="slide">
<img src="http://lorempixel.com/250/250" alt="">
</div>
<div class="slide">
<img src="http://lorempixel.com/250/250" alt="">
</div>
<div class="slide">
<img src="http://lorempixel.com/250/250" alt="">
</div>
<div class="slide">
<img src="http://lorempixel.com/250/250" alt="">
</div>
<div class="slide">
<img src="http://lorempixel.com/250/250" alt="">
</div>
<div class="slide">
<img src="http://lorempixel.com/250/250" alt="">
</div>
</div>
</div>
</body>
</html>

<style>
.container
max-width: 1000px;

.slick-track > div
opacity: 0;
transition: all 400ms ease-out;
transform: scale(0);


.slick-track > div.slick-active
opacity: 1;
transition: all 400ms ease-in;
transform: scale(1);

</style>

<script>
$(document).ready(function()
$('.references-slider').slick(
autoplay: false,
arrows: true,
dots: false,
slidesToShow: 6,
);
);
</script>









share|improve this question


























    0















    I would like to fade-zoom in and out the last and first slide of a Slick slider. I managed to do so, but when the slider has the "infinite" setting it will remove all slide classes of "slick-active" when the loop has to start over. The problem is that the slider then zooms/fades out completely for a small period of time.



    Can anyone help with keeping all slides visible but the first and last in viewport?



    Thanks!



    Codepen: https://codepen.io/thijs-webber/pen/drNYRo



    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    </head>
    <body>
    <div class="container">
    <div class="references-slider">
    <div class="slide">
    <img src="http://lorempixel.com/250/250" alt="">
    </div>
    <div class="slide">
    <img src="http://lorempixel.com/250/250" alt="">
    </div>
    <div class="slide">
    <img src="http://lorempixel.com/250/250" alt="">
    </div>
    <div class="slide">
    <img src="http://lorempixel.com/250/250" alt="">
    </div>
    <div class="slide">
    <img src="http://lorempixel.com/250/250" alt="">
    </div>
    <div class="slide">
    <img src="http://lorempixel.com/250/250" alt="">
    </div>
    <div class="slide">
    <img src="http://lorempixel.com/250/250" alt="">
    </div>
    </div>
    </div>
    </body>
    </html>

    <style>
    .container
    max-width: 1000px;

    .slick-track > div
    opacity: 0;
    transition: all 400ms ease-out;
    transform: scale(0);


    .slick-track > div.slick-active
    opacity: 1;
    transition: all 400ms ease-in;
    transform: scale(1);

    </style>

    <script>
    $(document).ready(function()
    $('.references-slider').slick(
    autoplay: false,
    arrows: true,
    dots: false,
    slidesToShow: 6,
    );
    );
    </script>









    share|improve this question
























      0












      0








      0








      I would like to fade-zoom in and out the last and first slide of a Slick slider. I managed to do so, but when the slider has the "infinite" setting it will remove all slide classes of "slick-active" when the loop has to start over. The problem is that the slider then zooms/fades out completely for a small period of time.



      Can anyone help with keeping all slides visible but the first and last in viewport?



      Thanks!



      Codepen: https://codepen.io/thijs-webber/pen/drNYRo



      <!DOCTYPE html>
      <html lang="en">
      <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>Document</title>
      </head>
      <body>
      <div class="container">
      <div class="references-slider">
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      </div>
      </div>
      </body>
      </html>

      <style>
      .container
      max-width: 1000px;

      .slick-track > div
      opacity: 0;
      transition: all 400ms ease-out;
      transform: scale(0);


      .slick-track > div.slick-active
      opacity: 1;
      transition: all 400ms ease-in;
      transform: scale(1);

      </style>

      <script>
      $(document).ready(function()
      $('.references-slider').slick(
      autoplay: false,
      arrows: true,
      dots: false,
      slidesToShow: 6,
      );
      );
      </script>









      share|improve this question














      I would like to fade-zoom in and out the last and first slide of a Slick slider. I managed to do so, but when the slider has the "infinite" setting it will remove all slide classes of "slick-active" when the loop has to start over. The problem is that the slider then zooms/fades out completely for a small period of time.



      Can anyone help with keeping all slides visible but the first and last in viewport?



      Thanks!



      Codepen: https://codepen.io/thijs-webber/pen/drNYRo



      <!DOCTYPE html>
      <html lang="en">
      <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta http-equiv="X-UA-Compatible" content="ie=edge">
      <title>Document</title>
      </head>
      <body>
      <div class="container">
      <div class="references-slider">
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      <div class="slide">
      <img src="http://lorempixel.com/250/250" alt="">
      </div>
      </div>
      </div>
      </body>
      </html>

      <style>
      .container
      max-width: 1000px;

      .slick-track > div
      opacity: 0;
      transition: all 400ms ease-out;
      transform: scale(0);


      .slick-track > div.slick-active
      opacity: 1;
      transition: all 400ms ease-in;
      transform: scale(1);

      </style>

      <script>
      $(document).ready(function()
      $('.references-slider').slick(
      autoplay: false,
      arrows: true,
      dots: false,
      slidesToShow: 6,
      );
      );
      </script>






      javascript css slick.js






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 14 hours ago









      ThijsThijs

      314




      314






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021255%2fslick-slider-animate-first-and-last-item-in-viewport%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021255%2fslick-slider-animate-first-and-last-item-in-viewport%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved