ezContentSlider

A jQuery plugin

A full-featured slider / fader with a carousel for thumbnails (or smaller), as well as a full-screen mode for when you want maximum visual impact.

Overview

You're correct, the world probably doesn't need another jQuery slider. With that said, the truth is, ezContentSlider does have a solid feature set and is worthy of your attention. It's also "designer & developer friendly" and eager to serve you.

  • It can slide. Or it can fade.
  • You can use the carousel. Or not use the carousel.
  • Plus, when you want to go big, it even has toggle to full-screen capability. There's also an option to "lazy load" the larger full-screen images.

Key Benefits & Features:

  • Extrememly Social
    Share to Social can be defined at the image (not just page) level.

  • Flexible and Robust
    Nearly everything is an option you can define / change.

  • You're in Control
    The markup is yours, the plugin just manipulates it for you. This approach also cuts down on the overhead associated with mucking with the DOM and such.

  • Clean & Easy To Follow
    If you feel you must, just fork it and make it your own. You're welcome.

What it doesn't do:

  • Force Majeure - ezContentSlider is a fine piece of well crafted machinery but it won't save you from the zombie apocolypse, vampire attacks, Godzilla, etc. It's good. But it's not that good.

    Sorry to disappoint you.

Demo

Images provided by FunPixPlus (FPP on Pinterest ).

Note: The links for the Share icons are not set up. They're only there so it's easy for you to imagine the possibilities.

• Demo 1 - Fades.

  • 1 - This is the caption for the regular sized image. 1 - The caption for the full screen can be different. Reg - One Large - One
  • 2 - Captions can contain a links. 2 - This is the caption for full screen. Reg - Two Large - Two
  • 3 - This is the caption for the regular sized image. 3 - This is the caption for the full screen. Reg - Three Large - Three
  • 4 - This is the caption for the regular sized image. 4 - This is the caption for the full screen. Reg - Four Large - Four
  • 5 - This is the caption for the regular sized image. 5 - This is the caption for the full screen. Reg - Five Large - Five
  • 6 - This is the caption for the regular sized image. 6 - This is the caption for the full screen. Reg - Six Full - Six
  • 7 - This is the caption for the regular sized image. 7 - This is the caption for the full screen. Reg - Seven Full - Seven

• Demo 2 - Slider.

  • 1 - This is the caption for the regular sized image. 1 - The caption for the full screen can be different. Reg - One Large - One
  • 2 - Captions can contain a links. 2 - This is the caption for full screen. Reg - Two Large - Two
  • 3 - This is the caption for the regular sized image. 3 - This is the caption for the full screen. Reg - Three Large - Three
  • 4 - This is the caption for the regular sized image. 4 - This is the caption for the full screen. Reg - Four Large - Four
  • 5 - This is the caption for the regular sized image. 5 - This is the caption for the full screen. Reg - Five Large - Five
  • 6 - This is the caption for the regular sized image. 6 - This is the caption for the full screen. Reg - Six Full - Six
  • 7 - This is the caption for the regular sized image. 7 - This is the caption for the full screen. Reg - Seven Full - Seven

How To

Standard jQuery setup. Please do a View Source of this page to see the markup requirements.

Put this before the close body tag.

Code Snippet

<script type="text/javascript">
							$(document).ready(function() {	
							  $('#demo').ezContentSlider({
							   	demoVarFoo : 'foo',
							   	demoVarBar : 'bar',
							  });	
							});
							</script>

Option : Default

  • startIndex : 0
    Integer - What slide should we start with.

    Note: The index of the first slide is 0 not 1.

  • loaderSelector : '.ezcs-loader'
    String - Selector (class) of the div that holds the spinner / loading .gif.

    Note: If you don't like the one provided, feel free to do your own.

  • controlsSwitchWrapperClass : '.ezcs-controls-switch-wrapper'
    String - Selector (class) of div that wraps all the control bar's icons (except the switch control). This div is toggled by the switch click.

  • controlsSwitchFadeDuration : 200
    Integer - Fancy a fade on the switch toggle. This is the value for the duration.

  • controlsSwitchClass : '.ezcs-control-switch',
    String - Selector (class) of the control bar's switch.

  • controlsThumbsClass : '.ezcs-control-thumbs'
    String - Selector (class) of the control bar's thumbs (i.e., show() / hide() carousel).

  • controlsCaptionClass : '.ezcs-control-caption'
    String -Selector (class) of the control bar's caption (i.e., show() / hide() caption).

  • controlsShareClass : '.ezcs-control-share'
    String - Selector (class) of the control bar's share (i.e., show() / hide() share icons).

  • controlsDisplayClass : '.ezcs-control-display'
    String - Selector (class) of the control bar's display (i.e., full-screen toggle).

  • controlsPlayClass : '.ezcs-control-play'
    String - Selector (class) of the control bar's play (i.e., play / pause).

  • carouselUse : true
    Bool - On init, setup the carousel. true, else any other value will be considered false.

    Note: You must be explicit about wanting the carousel. The plugin tends not to assume anything.

  • carouselPageSelectedClassName : 'ezcs-selected'
    String - Name of the class used to identify the current carousel slide.

    Note: This setting is simply the class name, the leading period (.) should not be included.

  • carouselWrapperSelector : '.ezcs-carousel-wrapper'
    String - Selector (class) of the div that wraps the whole carousel.

  • carouselPagesWrapperSelector : '.ezcs-carousel-pages-wrapper'
    String - Selector (class) of the div that wraps the thumbnails within the carousel.

  • carouselGroupNextSelector : '.ezcs-carousel-group-next'
    String - Selector (class) of the div for paging to the next group of thumbnails.

  • carouselGroupPrevSelector : '.ezcs-carousel-group-prev'
    String - Selector (class) of the div for paging to the previous group of thumbnails.

  • carouselGroupPageOverlap : 0
    Integer - How many thumbnails (aka pages) from the current group being displayed will be "overlapped" into the next / prev group to be diaplayed.

    Note: The intention of overlapping is to make it easier for users to follow the group paging.

  • carouselGroupPagingEffect : 'slide'
    String - Or 'fade'. Any value other than 'fade' will default to 'slide'.

  • carouselGroupPagingDuration : 250
    Integer - The duration of the .fadeOut() / .fadeIn() when paging from one group to the next.

  • carouselSlideEasing : 'swing'
    String - If carouselGroupPagingEffect : 'slide' then use this easing value (else this value gets ignored). Use 'swing' else any other value defaults to 'linear'.

  • carouselPageWidthInt : 68
    Integer - To save a bit of effort / overhead, the plugin doesn't calculate the width of the thumbnail. You need to set the total (of img width + borders + margins + paddings) here.

    Note: Just the integer (without the px).

  • carouselPageClickStopsPlayAuto : true
    Bool - A click on any thumbnail (aka page) in the carousel will stop the auto-play.

  • mainNextSelector : '.ezcs-main-next'
    String - Selector (class) of the div (positioned over the main slide) for moving to the next slide.

  • mainPrevSelector : '.ezcs-main-prev'
    String - Selector (class) of the div (positioned over the main slide) for moving to the previous slide.

  • mainNextPrevClickStopsPlayAuto : true
    Bool - A click on the main next / main prev will stop the auto-play.

  • mainFullImgRatioDataAttr : 'ezscfullimgratio'
    String - Used to create a data attribute used by the plugin.

    Note: 'data-' will be prefixed to this string to create a data attr.

  • mainFullImgWidthDataAttr : 'ezscfullimgwidth'
    String - Used to create a data attribute used by the plugin.

    Note: 'data-' will be prefixed to this string to create a data attr.

  • mainFullImgHeightDataAttr : 'ezscfullimgheight'
    String - Used to create a data attribute used by the plugin.

    Note: 'data-' will be prefixed to this string to create a data attr.

  • mainFullImgSrcDataAttr : 'ezscfullimgsrc'
    String - Used to create a data attribute used by the plugin.

    Note: 'data-' will be prefixed to this string to create a data attr.

  • mainFullImgReadyDataAttr : 'ezscfullimgready'
    String - Used to create a data attribute used by the plugin.

    Note: 'data-' will be prefixed to this string to create a data attr.

  • mainFullImgLazyLoad : true
    Bool - When set to true the plugin will do the following when toggling to full-screen: Initially use the normal image, stretch it to full-screen; then "lazy load" the full-screen image; once that's loaded replace the normal sized image with the full-screen image.

    Note: Using false could have a nasty negative impact on page size / load time.

  • slidesMainSelector : '.ezcs-main-slides'
    String - Selector (class) of the div that wraps just the images within a given (single) slide.

    Note: Use is TBD. That is, the plugin does not use this option at the moment.

  • slidesMainEffect : 'slide'
    String - Also 'fade', else any other value defaults to 'slide'.

    Note: slidesMainEffect does not necessarily have to match the carousel.

  • slidesMainFadeOutDuration : 300
    Integer - If slidesMainEffect : 'fade' then this is the duration of the fadeOut().

  • slidesMainFadeInDuration : 300
    Integer - If slidesMainEffect : 'fade' then this is the duration of the fadeIn().

  • slidesPerSlideDuration : 200
    Integer - If slidesMainEffect : 'slide', what "speed" is the slide transition.

    Note: This value should not be greater than playAutoDuration, and as such there's no code to check this. It's on you.

  • slidesPerSlideEasing : 'swing'
    String - If slidesMainEffect : 'slide' then use this easing value. Use 'swing' else any other value defaults to 'linear'.

  • captionRegClass : '.ezcs-caption-reg'
    String - Selector (class) of the span (or div, if you want) that wraps the caption for the regular (i.e., non full-screen) sized slide.

  • captionFullClass : '.ezcs-caption-full'
    String - Selector (class) of the span (or div, if you want) that wraps the caption for the full-screen sized slide.

  • captionIsShow : true
    Bool - Are we going to use the captions.

    Note: If false then it's up to you to sort out the markup. That is, remove the tool bar control or flip-flop the display:none.

  • shareRegClass : '.ezcs-share-reg'
    String - Selector (class) of the span (or div, if you want) that wraps the share icons / links for the regular (i.e., non full-screen) sized slide.

  • shareFullClass : '.ezcs-share-full'
    String - Selector (class) of the span (or div, if you want) that wraps the share icons / links for the full-screen sized slide.

  • shareIsShow : true
    Bool - Are we going to use share.

    Note: If false then it's up to you to sort out the markup. That is, remove the tool bar control or flip-flop the display:none.

  • displayRegClass : '.ezcs-display-reg'
    String - Selector (class) for the regular (i.e., non full-screen) elements. It's used when toggling between regular and full.

  • displayFullClass : '.ezcs-display-full'
    String - Selector (class) for the regular (i.e., non full-screen) elements. It's used when toggling between regular and full.

  • displayFullCloseWithEscape : true
    Bool - When in full-screen hitting the escape key will close the full-screen and toggel back to regular.

  • displayFullStyle : 'fill'
    String - How should the full-screen image be enlarged / resized. Use 'fit' else any other value defaults to 'fill'

    Note: 'fit' will not oversize the image to fill the screen. That is, the aspect ratio will be respected such that that whole image will be displayed.

  • displayFullFillCenterImg : true
    Bool - Center the full-screen image based on window size and image size.

  • displayFullImgWidth100PercentClassName : 'ezcs-width-100-percent'
    String - Value of the addClass() added.

    Note: This setting is simply the class name, the leading period (.) should not be included.

  • displayFullImgHeight100PercentClassName : 'ezcs-height-100-percent'
    String - Value of the addClass() added.

    Note: This setting is simply the class name, the leading period (.) should not be included.

  • fullToThisAddClassName : 'ezcs-status-fullscreen'
    String - Value of the addClass() added to the overall wrapped when toggling to full-screen.

    Note: This setting is simply the class name, the leading period (.) should not be included.

  • displayIsReg : true
    Bool - true means start in regular mode, else false means full-screen.

    Note: if you have muliple sliders on a page and want full-screen (i.e., false), use this options for only one of the sliders. Starting multiple sliders in full-screen really doesn't make sense.

  • playAutoPlaying: false
    Bool - If true the slide show will automatically start playing once everything is loaded, setup, etc.

  • playAutoDuration : 2000
    Integer - Duration of each slide when playAutoPlaying: true.

    Note: If slidesMainEffect : 'fade' then this value should be greater than slidesMainFadeOutDuration + slidesMainFadeInDuration.

  • playContinuous : true
    Bool - What happens once the last slide is auto played. true = when you get to the end, loop back to the start again (i.e., endless loop). false = stop at the end (i.e., play once).

Support

ezContentSlider uses GitHub for support / issue tracking:

https://github.com/ezWebDevTools/ezContentSlider/issues

Change Log

Section includes Known Bugs, Noteworthy TODOs, and Roadmap.

  • v0.5.9 - 27 July 2014
    • FIXED: Adding lazy load changed how ezContentSlider needed to "think".
  • v0.5.8 - 11 July 2014
    • FIXED: Carousel was getting mucked up by too many clicks too often.
    • FIXED: Mopped up a dingleberry with full-screen and Chrome (PC).
  • v0.5.7 - 10 July 2014
    • ADDED: "Lazy load" option for full-screen images.
  • v0.5.6 - 9 July 2014
    • FIXED: Make sure the selector is present on the current page. Don't try to setup the slider if there's no selector to set it up on. #Duh.
  • v0.5.5 - 9 Oct 2012
    • FIXED: One of the calls to function ezcsPlayAuto() passed an extra parm which (needless to say) mucked things up.
  • v0.5.4 - 18 Sept 2012
    • FIXED: ezcsIsBusy - main next / prev clicks are ignored until transition fadeIn (or slide over) is completed.
    • CHANGED: Did a load of variable renaming (read: shortened them) to try to make the overall file size smaller. Yes, they're still long but that's the price for making it so easy to read.
  • v0.5.3 - 17 Sept 2012
    • ADDED: Escape key closes full-screen.
    • ADDED: Main image next / prev keeps carousel in sync.
  • v0.5.2 - 13 Sept 2012
    • ADDED: var oEzcs - Single object makes it easier to pass a collection of vars that were previously "global".
    • CHANGED: Adding oEzcs resulted in clean up of orphaned code and vars.
    • ADDED: Support for multiple ezContentSliders per page.
    • ADDED Option / default carouselPageClickStopsPlayAuto - true / false.
    • ADDED Option / default mainNextPrevClickStopsPlayAuto - true / false.
    • ADDED Option / default displayFullStyle : 'fill' / 'fit' else any other value defaults to 'fill'.
    • ADDED Option / default displayFullFillCenterImg : true / false will resize full image from upper left corner (i.e., no centering).
    • CHANGED: A couple other settings, but nothing that effects functionality (per se).
  • v0.5.1 - 10 July 2012
    • ADDED: Tool bar support of social media share button (show / hide).
  • v0.5.0 - 10 July 2012
    • Happy birthday ezContentSlider.

Known Bugs

  • v0.5.8 - No known bugs.

TODOs

  • Refactor for speed / efficiency.
  • Make it easily work with other types of content (e.g., video embeds) and not just images. It's close but has not yet been fully tested for non-images.
  • Follow up on the lazy load enhancment(s) and make sure nothing else pops out somewhere.

Roadmap

  • Revist and rethink the whole lot. Building ezContentSlider was part self-educational, and part not being able to find a slider I was comfortable enough with to commit to. Over time (i.e., two years+) things change, skills grow and develop, etc.

FAQ

Frequently Asked Questions.

  1. TBD?

    Aenean non lorem consectetur...

License

The MIT License (MIT)

Copyright (c) 2016 Alchemy United

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

Giving credit and love where due.

Testimonials

These people have spoken.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sed elit at augue suscipit lacinia. Phasellus ultrices placerat pellentesque. Aenean ornare, sapien in tristique sollicitudin, massa lacus auctor dolor, et venenatis purus nisl et dui.

— Laoreet Accumsan

Pellentesque blandit ante nunc, in tincidunt augue porttitor imperdiet. Suspendisse pulvinar ultrices felis, ac luctus mauris tempor ac.

— Sodales Dignissim

Share

Be a good sport and show the world your love for ezContentSlider.

Additional Info

Also known as: None of the Above.

  • When tweeting please use: #ezContentSlider, as well as @ezWebDevTools, @ChiefAlchemist1 and/or @AlchemyUnited.
  • You might also be interested in the Bootstrap prototyping tool Pingendo (http://www.pingendo.com )