JSFiddle - React, Tailwind, and code Playground

by jfriend00

HTML

<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
</head>

<div id="slider"></div>

<div class="file-list">
 <div class="file-cell">
    <div class="thumb-wrapper">
      <img title="mytitle" width="150" alt="myalt" src="http://photos.smugmug.com/photos/344291068_HdnTo-S.jpg">
    </div>
  </div>
  <div class="file-cell">
    <div class="thumb-wrapper">
      <img title="mytitle" width="150" alt="myalt" src="http://photos.smugmug.com/photos/344290962_h6JjS-S.jpg">
    </div>
  </div>
</div>

CSS

#slider {
    width: 300px;
    margin: 20px 0;
}

JavaScript

jQuery(document).ready(function() {

    var images = jQuery('.thumb-wrapper img'); //caches the query when dom is ready
    var CELL_WIDTH = 150;
    var ASPECT = 1.5;
        
    jQuery( "#slider" ).slider({
        step: 5,
        min: 70,
        max: 200,
        value: 100,
        slide: function(event, ui) {
            var size = (CELL_WIDTH * ui.value / 100) + "px";
            images.stop(true).animate({width: size, height: size / ASPECT}, 250);
        }
    });

});