simplyScroll v2

a flexible jQuery content scroller with touch support

Pause/resume scrolling, auto mode only

Jump to: [HTML] [Javascript] [CSS]

A pause button. Pause, resume. Pause, resume. Rinse, repeat.

HTML

<ul id="scroller">
	<li><img src="image1.jpg" width="290" height="200"></li>
	<li><img src="image2.jpg" width="290" height="200"></li>
	<li><img src="image3.jpg" width="290" height="200"></li>
    ...
</ul>            

Javascript

<script type="text/javascript" 
src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js">
</script>
<script type="text/javascript" src="jquery.simplyscroll.js"></script>
<link rel="stylesheet" href="jquery.simplyscroll.css" media="all" 
type="text/css">

<script type="text/javascript">
(function($) {
  $(function() { //on DOM ready
    $("#scroller").simplyScroll({
      pauseButton: true
    });
  });
})(jQuery);
</script>

CSS

The styles are included in the CSS supplied.

/* Container DIV - automatically generated */
.simply-scroll-container { 
	position: relative;
}

/* Clip DIV - automatically generated */
.simply-scroll-clip { 
	position: relative;
	overflow: hidden;
}

/* UL/OL/DIV - the element that simplyScroll is inited on
Class name automatically added to element */
.simply-scroll-list { 
	overflow: hidden;
	margin: 0;
	padding: 0;
	list-style: none;
}
	
.simply-scroll-list li {
	padding: 0;
	margin: 0;
	list-style: none;
}
	
.simply-scroll-list li img {
	border: none;
	display: block;
}

/* Custom class modifications - adds to / overrides above

.simply-scroll is default base class */

/* Container DIV */
.simply-scroll { 
	width: 576px;
	height: 200px;
	margin-bottom: 1em;
}

/* Clip DIV */
.simply-scroll .simply-scroll-clip {
	width: 576px;
	height: 200px;
}
	
/* Explicitly set height/width of each list item */	
.simply-scroll .simply-scroll-list li {
	float: left; /* Horizontal scroll only */
	width: 290px;
	height: 200px;
}

/* Default pause button rules */
.simply-scroll-btn {
    position: absolute;
    background-image: url(buttons.png);
    width: 42px;
    height: 44px;
    z-index:3;
    cursor: pointer;
}

.simply-scroll-btn-pause {
    right: 6px;
    bottom: 6px;
    background-position: -168px -44px;
}
.simply-scroll-btn-pause:hover, .simply-scroll-btn-pause:focus {
    background-position: -168px -88px;
}

.simply-scroll-btn-pause.active {
    background-position: -84px -44px;
}
.simply-scroll-btn-pause.active:hover, .simply-scroll-btn-pause.active:focus {
    background-position: -84px -88px;
}

« Back to simplyScroll Home

Fork me on GitHub