Press "Enter" to skip to content

jQuery Content Carousel Slider Plugin | heroCarousel

HeroCarousel is a simple and lightweight jQuery plugin that enables you to render HTML elements in a fully configurable carousel slider.

jquery carousel slider example code, carousel slider using jquery, jquery carousel slider plugin, jquery slider plugin, jquery slider plugin free download, carousel js

Features:

  • Autoplay and pause when scrolling.
  • Navigate between arrows and pagination point.
  • x items in one slide.
  • Item counter.
  • infinite loop.

A Vanilla JavaScript Content Carousel Slider Plugin | gaBasicSlider

How to make use of it:

1. Load the jQuery library and jQuery heroCarousel plugin into the HTML page.

<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="heroCarousel.js"></script>

2. HTML structure to create a basic image circle display with the main text.

<div class="heroCarousel">
  <div class="heroCarouselWindow">
    <ul>
    
      <li>
        <div class="heroCarouselImage"><a href="#"><img src="1.jpg"></a></div>
        <div class="heroCarouselContent">
          <div class="heroCarouselContentInner">
            <div class="heroCarouselHeader">Header 1</div>
            <div class="heroCarouselText">Text 1</div>
            <div class="heroCarouselButton"><a href="">Button 1</a></div>
          </div>
        </div>
      </li>
      
      <li>
        <div class="heroCarouselImage"><a href="#"><img src="2.jpg"></a></div>
        <div class="heroCarouselContent">
          <div class="heroCarouselContentInner">
            <div class="heroCarouselHeader">Header 2</div>
            <div class="heroCarouselText">Text 2</div>
            <div class="heroCarouselButton"><a href="">Button 2</a></div>
          </div>
        </div>
      </li>
      
      <li>
        <div class="heroCarouselImage"><a href="#"><img src="3.jpg"></a></div>
        <div class="heroCarouselContent">
          <div class="heroCarouselContentInner">
            <div class="heroCarouselHeader">Header 3</div>
            <div class="heroCarouselText">Text 3</div>
            <div class="heroCarouselButton"><a href="">Button 3</a></div>
          </div>
        </div>
      </li>
      
      ...
      
    </ul>
  </div>
</div>

3. Basic CSS Styles for the Carousel Plugin. Add the following CSS snippets to your CSS file.

.heroCarousel {
  position: relative;
  margin: 0 0 25px;
}

.heroCarousel .heroCarouselWindow {
  border: 1px solid #bbbbbb !important;
  overflow: hidden;
 *position: relative;
}

.heroCarousel .heroCarouselWindow ul {
  position: relative;
  left: 0;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
  width: 10000px;
  list-style-type: none;
  white-space: nowrap;
  -webkit-transition-property: left;
  -moz-transition-property: left;
  -o-transition-property: left;
  transition-property: left;
  -webkit-transition-duration: 0.5s;
  -moz-transition-duration: 0.5s;
  -o-transition-duration: 0.5s;
  transition-duration: 0.5s;
}

.heroCarousel .heroCarouselWindow ul li {
  position: relative;
  float: left;
  white-space: normal;
}

.heroCarousel .heroCarouselImage a { display: block; }

.heroCarousel .heroCarouselImage img {
  width: 938px;
  height: 298px;
}

.heroCarousel .heroCarouselContent {
  display: table;
  position: absolute;
  background-color: black;
  color: white;
  margin: 20px 0;
  top: 0;
  right: 0;
  width: 500px;
  height: 258px;
}

.heroCarousel .heroCarouselContent.flip { left: 0; }

.heroCarousel .heroCarouselContent .heroCarouselContentInner {
  padding: 25px;
  display: table-cell;
  vertical-align: middle;
}

.heroCarousel .heroCarouselContent .heroCarouselContentInner .heroCarouselHeader {
  margin: 0 0 15px;
  font-size: 22px;
  line-height: 1.4;
}

.heroCarousel .heroCarouselContent .heroCarouselContentInner .heroCarouselText {
  font-size: 15px;
  margin: 0 0 15px;
}

.heroCarousel .heroCarouselContent .heroCarouselContentInner .heroCarouselButton a {
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  -ms-border-radius: 5px;
  -o-border-radius: 5px;
  border-radius: 5px;
  display: inline-block;
  background-color: #1c3e60;
  color: white !important;
  line-height: 25px;
  font-size: 12px;
  padding: 1px 15px 0;
}

.heroCarousel .heroCarouselControls {
  clear: both;
  text-align: center;
}

.heroCarousel .heroCarouselPrevious,
.heroCarousel .heroCarouselNext {
  display: inline-block;
  overflow: hidden;
  width: 32px;
  height: 33px;
  background-color: transparent;
  background-position: 0 0;
  background-repeat: no-repeat;
  text-indent: 100%;
  white-space: nowrap;
 *text-indent: 0;
 *font-size: 0;
}

.heroCarousel .heroCarouselPrevious { background-image:  }

.heroCarousel .heroCarouselPrevious.disabled {
  background-image: ;
  cursor: default;
}

.heroCarousel .heroCarouselPrevious:focus { background-color: transparent !important; }

.heroCarousel .heroCarouselNext { background-image: }

.heroCarousel .heroCarouselNext.disabled {
  background-image: ;
  cursor: default;
}

.heroCarousel .heroCarouselNext:focus { background-color: transparent !important; }

.heroCarousel.heroCarouselNavigationOutside .heroCarouselPrevious,
.heroCarousel.heroCarouselNavigationOutside .heroCarouselNext {
  position: absolute;
  top: 0;
  height: 298px;
  background-position: 50% 50%;
}

.heroCarousel.heroCarouselNavigationOutside .heroCarouselPrevious { left: -16px; }

.heroCarousel.heroCarouselNavigationOutside .heroCarouselNext { right: -16px; }

.heroCarousel.heroCarouselNavigationInline .heroCarouselNext { margin: 0 0 0 20px; }

.heroCarousel.heroCarouselNavigationInline .heroCarouselPrevious { margin: 0 20px 0 0; }

.heroCarousel .heroCarouselPagination {
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fefefe), color-stop(100%, #ededed));
  background-image: -webkit-linear-gradient(#fefefe, #ededed);
  background-image: -moz-linear-gradient(#fefefe, #ededed);
  background-image: -o-linear-gradient(#fefefe, #ededed);
  background-image: linear-gradient(#fefefe, #ededed);
  display: block;
  width: 100%;
  height: 30px;
  line-height: 30px;
  text-align: center;
 *position: relative;
 *zoom: 1;
}

.heroCarousel .heroCarouselPaginationButton {
  display: inline-block;
  overflow: hidden;
  margin: 0 6px;
  width: 11px;
  height: 11px;
  background-color: transparent;
  background-image: ;
  background-position: 0 0;
  background-repeat: no-repeat;
  text-indent: 100%;
  white-space: nowrap;
 *text-indent: 0;
 *font-size: 0;
}

.heroCarousel .heroCarouselPaginationButton.active {
  background-image: ;
  cursor: default;
}

.heroCarousel .heroCarouselPaginationButton:focus { background-color: transparent; }

.heroCarousel .heroCarouselNavigationCounter {
  color: #000;
  font-size: 12px;
  background-color: #fff;
  border: 1px solid #000;
  padding: 2px 0;
  position: absolute;
  top: -10px;
  left: 110px;
  text-align: center;
  width: 60px;
}

4. Call the function to activate the content circle.

$('.heroCarousel').heroCarousel({
  // OPTIONS
});

5. Customization options with default values.

// autoplay
autoplay: false,

// autoplay delay
autoplaySpeed: 5000,

// pause on hover
autoplayPauseOnHover: true,

// how many items shown per one slide
itemsToShow: 3,

// enable image links
heroImageLink: true,

// show hero text
showHeroText: true,

// show item counter
counter: false,

// enable pagination
pagination: true,

// enable pagination
navigation: true,

// the poistion of the arrows navigation
navigationPosition: 'Outside'

Small Easy jQuery Content Carousel Slider, Hero Carousel Component Plugin/Github


See Demo And Download

Official Website(TechTarget): Click Here

This superior jQuery/javascript plugin is developed by TechTarget. For extra advanced usage, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.