KevinBatdorf / liquidslider

A Responsive jQuery Content Slider
161 stars 63 forks source link

Liquid Slider

A Responsive jQuery HTML Content Slider

Demo Page | Example Page (Advanced)

I'm on Twitter: @Kevin Batdorf

Update

I'm going to make this compatible with NPM soon, but for now there's a work around. Two issues:

1) You still need to load in the dependencies on your own 2) the asset files wil have to be manually moved, or overridden in your own css

Installation

NPM

npm install --save git+https://git@github.com/KevinBatdorf/liquidslider.git

then in your js file add

import 'liquidslider/js/jquery.liquid-slider.min.js'

The stylesheet is plain css, but you can load it in with sass

@import "node_modules/liquidslider/css/liquid-slider";

The manual way:

  1. Download the files to your working directory.
  2. Link files in the header and footer.
<head>
  <link rel="stylesheet" href="https://github.com/KevinBatdorf/liquidslider/blob/master/dist/css/liquid-slider.css">
</head>
<body>
  <footer>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.touchswipe/1.6.4/jquery.touchSwipe.min.js"></script>
    <script src="https://github.com/KevinBatdorf/liquidslider/raw/master/dist/js/jquery.liquid-slider.min.js"></script>
  </footer>
</body>

How to use

Structure your html in a manner similar to below:

<section class="liquid-slider" id="main-slider">
  <div>
    <h2 class="title">Slide 1</h2>
    <p>Content</p>
  </div>
  <div>
    <h2 class="title">Slide 2</h2>
    <p>Content</p>
  </div>
</section>
  1. Initialize the content slider somewhere after the script.
jQuery(function($) {
  $('#main-slider').liquidSlider();
});

If you would like to edit a setting, do so like this:

jQuery(function($) {
  $('#main-slider').liquidSlider({
    setting: value,
    setting: value
  });
});

Default Settings

autoHeight: true,
minHeight: 0,
heightEaseDuration: 1500,
heightEaseFunction: 'easeInOutExpo',

slideEaseDuration: 1500,
slideEaseFunction: 'easeInOutExpo',
slideEaseFunctionFallback: 'swing',
animateIn: 'bounceInRight',
animateOut: 'bounceOutRight',
continuous: true,
fadeInDuration: 500,
fadeOutDuration: 500,

autoSlide: false,
autoSlideDirection: 'right',
autoSlideInterval: 6000,
forceAutoSlide: false,
pauseOnHover: false,

dynamicArrows: true,
dynamicArrowsGraphical: true,
dynamicArrowLeftText: '&#171; left',
dynamicArrowRightText: 'right &#187;',
hideSideArrows: false,
hideSideArrowsDuration: 750,
hoverArrows: true,
hoverArrowDuration: 250,

dynamicTabs: true,
dynamicTabsHtml: true,
includeTitle: true,
panelTitleSelector: '.title',
dynamicTabsAlign: 'left',
dynamicTabsPosition: 'top',
navElementTag: 'div',

firstPanelToLoad: 1,
hashLinking: false,
hashTitleSelector: '.title',

keyboardNavigation: false,
leftKey: 39,
rightKey: 37,
panelKeys: {
  1: 49,
  2: 50,
  3: 51,
  4: 52
},

responsive: true,
mobileNavigation: true,
mobileNavDefaultText: 'Menu',
mobileUIThreshold: 0,
hideArrowsWhenMobile: true,
hideArrowsThreshold: 0,
useCSSMaxWidth: 3000,

preload: function() {
  this.finalize();
},
onload: function() {},
pretransition: function() {
  this.transition();
},
callback: function() {},

preloader: false,
swipe: true,
swipeArgs: undefined

Versions

Version 2.3.8

Version 2.3.7

Version 2.3.6

Version 2.3.2

Version 2.3.2

Version 2.3.1

Version 2.3.0

Version 2.2.0

Version 2.1

Version 2.0.12

Version 2.0.11

Version 2.0.10

Version 2.0.9

Version 2.0.8

Version 2.0.7

Version 2.0.6

Version 2.0.5

Version 2.0.4

Version 2.0.3

Version 2.0.2

Version 2.0.1

Version 2.0.0

Version 1.3.7

Version 1.3.6

Version 1.3.5

Version 1.3.4

Version 1.3.3

Version 1.3.2

Version 1.3.1

Version 1.3.0

Version 1.2.9

Version 1.2.8

Version 1.2.7

Version 1.2.6

Version 1.2.4 - 1.2.5

Version 1.2.3

Version 1.2.2

Version 1.2.1

Version 1.2.0