<!--
/*************************************************************
* This script is developed by Arturs Sosins aka ar2rsawseen, http://webcodingeasy.com
* Fee free to distribute and modify code, but keep reference to its creator
*
* Content slider class provides sliding effect for different page or content switching
* It can bind content elements to provided menu or allow visitors to change content
* using throwing (dragging and dropping) method.
* Content sliding speed and sliding directions are customizable
*
* For more information, examples and online documentation visit:
* http://webcodingeasy.com/JS-classes/Content-sliding-effect
**************************************************************/
-->
<html>
<head>
<style>
body
{
overflow: hidden;
}
.content
{
border: 1px solid red;
}
</style>
</head>
<body>
<h3>Change content elements using menu</h3>
<h3>or just drag content element to preferred direction and drop it (like throwing) to change content element</h3>
<div id='menu'>
<ul>
<li><a href='#' rel='item_1' >elem 1</a></li>
<li><a href='#' rel='item_2' >elem 2</a></li>
<li><a href='#' rel='item_3' >elem 3</a></li>
<li><a href='#' rel='item_4' >elem 4</a></li>
</ul>
</div><!-- menu -->
<div id='content'>
<div id='item_1' style='width: 300px;' class='content'>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<div id='item_2' style='width: 600px;' class='content'>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<div id='item_3' style='width: 400px;' class='content'>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<div id='item_4' style='width: 700px;' class='content'>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
</div><!-- content -->
<script src="./content_slider.packed.js" type="text/javascript"></script>
<script>
var slide = new content_slider("content", {speed: 5, direction: "x", menu: "menu", callback: function(id, d){
if(d > 0)
{
//comes from right side
}
else
{
//is current element or come from left side
}
//block content change for 10
return 10;
}});
</script>
</body>
</html> |