//Easing
// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert(jQuery.easing.default);
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});
jQuery(function($) {
$('.single-desc .img').addClass('setTransition-1');
$('#products').before('<ul id="nav">').cycle({
fx: 'scrollHorz',
speed: 'slow',
timeout: 0,
pager: '#nav',
easing: 'easeOutQuad',
slideExpr: 'section' ,
// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#" class="button" >next</a></li>';
}
});
$('a[href=#desc]').addClass('current').click(function() {
$('#nav li:eq(0) a').trigger('click');
$(this).addClass('current');
$('.single-guide .img,.single-guide .txt').addClass('setTransition-3');
$('.single-desc .img,.single-desc .txt').removeClass('setTransition-2');
$('.single-desc .img,.single-desc .txt').addClass('setTransition-1');
$('a[href=#gal]').removeClass('current');
$('a[href=#guide]').removeClass('current');
return false;
});
$('a[href=#guide]').click(function() {
$('#nav li:eq(1) a').trigger('click');
$(this).addClass('current');
$('.single-guide .img,.single-guide .txt').removeClass('setTransition-3');
$('.single-desc .img,.single-desc .txt').addClass('setTransition-2');
$('.single-guide .img,.single-guide .txt').removeClass('setTransition-2');
$('.single-guide .img,.single-guide .txt').addClass('setTransition-1');
$('a[href=#gal]').removeClass('current');
$('a[href=#desc]').removeClass('current');
return false;
});
$('a[href=#gal]').click(function() {
$('#nav li:eq(2) a').trigger('click');
$(this).addClass('current');
$('.single-gal .img,.single-gal .txt').addClass('setTransition-3');
$('.single-guide .img,.single-gal .txt').removeClass('setTransition-2');
$('.single-guide .img,.single-gal .txt').addClass('setTransition-1');
$('a[href=#guide]').removeClass('current');
$('a[href=#desc]').removeClass('current');
return false;
});
});
<div class="inner">
<div class="innerWrap">
<menu class="navmenu">
<ul>
<li><a href="#desc">Desc</a></li>
<li><a href="#guide">Guide</a></li>
<li><a href="#gal">Gallery</a></li>
</ul>
</menu>
<h2>The Sample</h2>
<section id="products" class="products">
<div class="clearfix">
<section class="single-desc fl">
<div class="fl img">
<img src="http://farm4.static.flickr.com/3201/2746960560_e09c2f50ae_z.jpg" />
</div>
<div class="fr txt">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</section>
<section class="single-guide fl">
<div class="fl img">
<img src="http://farm4.static.flickr.com/3435/3382574492_2a1210680a_z.jpg?zz=1" />
</div>
<div class="fr txt">
<p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
</div>
</section>
<section class="single-gal fl">
</section>
</div>
</section>
<?php endwhile; endif; ?>
</div>
</div>
/* CSS Reset HTML5 BOILERPLATE*/
/* =============================================================================
HTML5 display definitions
========================================================================== */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }
audio:not([controls]) { display: none; }
/* =============================================================================
Base
========================================================================== */
html { font-size: 100%; overflow-y: scroll; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
body { margin: 0; font-size: 13px; line-height: 1.231; }
body, button, input, select, textarea { font-family: sans-serif; color: #222; }
::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
::selection { background: #fe57a1; color: #fff; text-shadow: none; }
/* =============================================================================
Links
========================================================================== */
a { color: #00e; }
a:visited { color: #551a8b; }
a:focus { outline: thin dotted; }
a:hover, a:active { outline: 0; }
/* =============================================================================
Typography
========================================================================== */
abbr[title] { border-bottom: 1px dotted; }
b, strong { font-weight: bold; }
blockquote { margin: 1em 40px; }
dfn { font-style: italic; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
ins { background: #ff9; color: #000; text-decoration: none; }
mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
pre, code, kbd, samp { font-family: monospace, monospace; _font-family: 'courier new', monospace; font-size: 1em; }
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
q { quotes: none; }
q:before, q:after { content: ""; content: none; }
small { font-size: 85%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }
/* =============================================================================
Lists
========================================================================== */
ul, ol { margin: 1em 0; padding: 0 0 0 40px; }
dd { margin: 0 0 0 40px; }
nav ul, nav ol { list-style: none; margin: 0; padding: 0; }
/* =============================================================================
Embedded content
========================================================================== */
img { border: 0; -ms-interpolation-mode: bicubic; }
svg:not(:root) { overflow: hidden; }
/* =============================================================================
Figures
========================================================================== */
figure { margin: 0; }
/* =============================================================================
Forms
========================================================================== */
form { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
label { cursor: pointer; }
legend { border: 0; *margin-left: -7px; padding: 0; }
button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; }
button, input { line-height: normal; *overflow: visible; }
table button, table input { *overflow: auto; }
button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; }
input[type="checkbox"], input[type="radio"] { box-sizing: border-box; }
input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none;}
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
textarea { overflow: auto; vertical-align: top; resize: vertical;}
input:valid, textarea:valid { }
input:invalid, textarea:invalid { background-color: #f0dddd; }
/* =============================================================================
Tables
========================================================================== */
table { border-collapse: collapse; border-spacing: 0; }
/* Line Contents */
.inner {
background: #FFFFFF;
height: 100%;
min-height: 600px;
width: 580px;
margin: 0 auto;
padding: 0;
}
.inner h2 {
background: none repeat scroll 0 0 #EEEEEE;
color: #333333;
font-size: 2.5em !important;
height: 100%;
margin: 1em 0 0;
padding: 15px;
position: relative;
text-shadow: -1px -1px 0 #FFFFFF;
width: 550px;
z-index: 99;
}
.innerWrap {
margin: 0 auto;
padding: 0;
width: 580px;
overflow: hidden;
}
.innerWrap img {
background: none repeat scroll 0 0 transparent;
height: auto;
margin: 0 -25em;
padding: 0;
position: relative;
top: -51px;
width: 500px;
z-index: 10;
}
.innerWrap p {
line-height: 1.5em;
margin: 0 5em;
padding: 10px;
text-align: justify;
width: 200px;
position: relative;
z-index: 12;
}
.single-desc {
margin: 0;
padding: 25px;
width: 560px;
}
.single-guide{
display: none;
margin: 0;
padding: 25px;
width: 560px;
}
.single-gal{
display: none;
margin: 0;
padding: 25px;
width: 560px;
}
/* Products */
/*@-webkit-keyframes moving {
from { right: -99em;opacity:0; }
to { right:0em;opacity:1.0; }
}
@-moz-keyframes moving {
from { right: -99em;opacity:0; }
to { right:0em;opacity:1.0; }
}
*/
.img.setTransition-1{
-webkit-transform: translate(0px, 0pt);
-moz-transform: translate(0px, 0pt);
-o-transform: translate(0px, 0pt);
transform: translate(0px, 0pt);
-webkit-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
-moz-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
-o-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
}
.img.setTransition-2{
-webkit-transform: translate(-2000px, 0pt);
-moz-transform: translate(-2000px, 0pt);
-o-transform: translate(-2000px, 0pt);
transform: translate(-2000px, 0pt);
-webkit-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
-moz-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
-o-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
}
.img.setTransition-3{
-webkit-transform: translate(999em, 0pt);
-moz-transform: translate(999em, 0pt);
-ms-transform: translate(999em, 0pt);
transform: translate(999em, 0pt);
-webkit-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
-moz-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
-o-transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
transition:all 1s cubic-bezier(0.25, 0, 0.25, 1);
}
.txt.setTransition-1{
-webkit-transform: translate(0px, 0pt);
-moz-transform: translate(0px, 0pt);
-o-transform: translate(0px, 0pt);
transform: translate(0px, 0pt);
-webkit-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
-moz-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
-o-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
}
.txt.setTransition-2{
-webkit-transform: translate(-2000px, 0pt);
-moz-transform: translate(-2000px, 0pt);
-o-transform: translate(-2000px, 0pt);
transform: translate(-2000px, 0pt);
-webkit-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
-moz-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
-o-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
}
.txt.setTransition-3{
-webkit-transform: translate(999em, 0pt);
-moz-transform: translate(999em, 0pt);
-ms-transform: translate(999em, 0pt);
transform: translate(999em, 0pt);
-webkit-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
-moz-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
-o-transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
transition:all 0.7s cubic-bezier(0.25, 0, 0.25, 1);
}
#nav{
display: none;
visibility: hidden;
}
/* nav inner */
.navmenu {
margin: 0 -20em;
padding: 0;
position: relative;
top: 3.5em;
z-index: 100;
}
.navmenu ul {
float: right;
list-style: none outside none;
margin: 0px;
padding: 5px;
width: 500px;
}
.navmenu ul li {
display: inline-block;
text-align: center;
width: 50px;
}
.navmenu ul li:hover {
}
.navmenu li a {
-webkit-transition: color 0.2s ease-in 0s;
-moz-transition:color 0.2s ease-in 0s;
-o-transition: color 0.2s ease-in 0s;
transition: color 0.2s ease-in 0s;
color: #333333;
display: block;
font-size: 1.2em;
margin: 0;
padding: 5px;
text-decoration: none;
text-shadow: -1px -1px 0 #F2F2F2;
outline: none;
}
.navmenu li a.current{
color: #7A8F38;
}
.navmenu li a:hover {
color: #7A8F38;
text-shadow: -1px -1px 0 #FFFFFF;
}
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }
.fl{float: left;}
.fr{float:right;}
External resources loaded into this fiddle: