2017 © Pedro Peláez
 

library js_slider

image

samsonos/js_slider

  • Wednesday, September 23, 2015
  • by samsonos
  • Repository
  • 2 Watchers
  • 1 Stars
  • 545 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 4 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

JS slider for SamsonPHP framework

Generic javascript carousel slider, (*1)

The content of slider must be located in < class="sjs-slider"> element, wrapped by parent element:, (*2)

<div class="sliderContainer">
    <ul class="sjs-slider">
        <li class="sjs-slide">slide1</li>
        <li class="sjs-slide">slide2</li>
        <li class="sjs-slide">slide3</li>
    </ul>
</div>

Module adding

For module adding:, (*3)

sliderContainer.slider();

For switched elements in your html-code should be set classes arrow-left for the left and arrow-right for the right., (*4)

Module options

The module has a list of parameters which could be set while adding, (*5)

  • leftButton – explicitly indicate switch to the left
  • rightButton – explicitly indicate switch to the right
  • autoScroll – automatic scrolling
  • num – the number of displayed elements

The width and number of slides

Module defines width of slide on the basis of general width of parent < class="sjs-slider"> element and number of displayed elements (parameter num). The width of the slide will be divided equally into a number of displayed elements. Therefore you should exactly set width of a block sliderContainer in styles., (*6)

Example

If you want to add in project slider composed of two arrows and view-port from 4 slides with width 252px then:, (*7)

html, (*8)

<div class="arrow-left"></div>
<div class="sliderContainer">
    <ul class="sjs-slider">
        <li class="sjs-slide">slide1</li>
        <li class="sjs-slide">slide2</li>
        <li class="sjs-slide">slide3</li>
        <li class="sjs-slide">slide4</li>
        <li class="sjs-slide">slide5</li>
    </ul>
</div>
<div class="arrow-left"></div>

css, (*9)

.sliderContainer {
  text-align: center;
  overflow: hidden;
  width: 1008px;
}
.sliderContainer li {
  overflow: hidden;
}

js, (*10)

s('.sliderContainer').pageInit(function(sliderContainer){
    sliderContainer.slider({
        num : 4
    });
});

The Versions

23/09 2015

dev-master

9999999-dev http://samsonos.com/

  Sources   Download

Open Software License (OSL) v 3.0

The Requires

 

23/09 2015

0.0.1

0.0.1.0 http://samsonos.com/

  Sources   Download

Open Software License (OSL) v 3.0

The Requires