Skip to content

Instantly share code, notes, and snippets.

@Wilto
Created January 8, 2011 21:38
Show Gist options
  • Save Wilto/771170 to your computer and use it in GitHub Desktop.
Save Wilto/771170 to your computer and use it in GitHub Desktop.
I know I'm reinventing the wheel here, but this is a simple carousel I whipped up for the sake of flexible layouts.
<!DOCTYPE html>
<html lang="en" id="home" class="somethingElse">
<head>
<meta charset="utf-8" />
<title>Carousel Plugin</title>
<meta name="description" content="There are many like it, but this one is mine." />
<link rel="stylesheet" href="css/style.css" media="screen" />
<style type="text/css" media="screen">
ul { margin: 0; padding: 0; list-style: none; }
a.disabled { color: #aaa; }
</style>
</head>
<!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie7"> <![endif]-->
<!--[if IE 8 ]> <body class="ie8"> <![endif]-->
<!--[if gt IE 8]> <body> <![endif]-->
<!--[if !IE]><!--> <body> <!--<![endif]-->
<div class="slidewrap">
<ul class="slidecontrols">
<li><a href="#sliderName" class="next">Next</a></li>
<li><a href="#sliderName" class="prev">Prev</a></li>
</ul>
<ul class="slider" id="sliderName">
<li class="slide">
<h2>First Slide</h2>
<p>In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien. Phasellus quis est sed turpis sollicitudin venenatis sed eu odio. Praesent eget neque eu eros interdum malesuada non vel leo. Sed fringilla porta ligula egestas tincidunt. Nullam risus magna, ornare vitae varius eget, scelerisque a libero.</p>
</li>
<li class="slide">
<h2>Second Slide</h2>
<p>In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien.</p>
</li>
<li class="slide">
<h2>Third Slide</h2>
<p>Phasellus quis est sed turpis sollicitudin venenatis sed eu odio. Praesent eget neque eu eros interdum malesuada non vel leo. Sed fringilla porta ligula egestas tincidunt. Nullam risus magna, ornare vitae varius eget.</p>
</li>
<li class="slide">
<h2>Fourth Slide</h2>
<p>In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien. Phasellus quis est sed turpis sollicitudin venenatis sed eu odio.</p>
</li>
<li class="slide">
<h2>Fif' Slide</h2>
<p>In hac habitasse platea dictumst. Nam pulvinar, odio sed rhoncus suscipit, sem diam ultrices mauris, eu consequat purus metus eu velit. Proin metus odio, aliquam eget molestie nec, gravida ut sapien.</p>
</li>
</ul>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="plugins.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('.slidewrap').carousel({
slider: '.slider',
slide: '.slide',
nextSlide: '.next',
prevSlide: '.prev',
speed: 300 // ms.
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment