The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: ruzz311 | April 28, 2010 @ 4:06pm
PHP Code
[
Download
]
$(document).ready(function(){ //slideshow transition type - all transition types included with jquery cycle will work var transition = 'fade'; //turn the pan's negative if you'd like to transition the other way var pan_x = -30; var pan_y = -150; //# of seconds between fades var fadeDisplayTime = 7 //# of seconds it takes to pan on the x/y axis var pan_x_time = 7 var pan_y_time = 7 $("#menu a").blend(); //-------------- begin cycle plugin with panning effect $.fn.getXdir = function (){ return ( $(this).hasClass("panLeft") ) ? 1 : -1; } $.fn.getYdir = function (){ return ( $(this).hasClass("panDown") ) ? 1 : -1; } $.fn.initSlidePos = function ( x, y ){ //Set x if( $(this).getXdir() < 0 ) { $(this).css({ left: 0 }); } else { $(this).css({ left: (x * $(this).getXdir() ) }); } //Set y if( $(this).getYdir() < 0 ) { $(this).css({ top: 0 }); }else{ $(this).css({ top: ( y * $(this).getYdir() ) }); } return $(this); } var firstTime = true; $('#slides').cycle({ fx: transition, timeout: (fadeDisplayTime * 1000), before: function(currSlideElement, nextSlideElement, options, forwardFlag){ var $obj = $(this); if(firstTime){ $obj.initSlidePos( pan_x, pan_y); firstTime = false; } setTimeout( function(){ $obj.initSlidePos( pan_x, pan_y ); }, 50); }, after: function(currSlideElement, nextSlideElement, options, forwardFlag){ var $obj = $(this); if( $obj.getXdir() < 0 ) { $obj.animate({ left: pan_x },{ duration: (1000 * pan_x_time), queue:true }); } else { $obj.animate({ left: "0" },{ duration:(1000 * pan_x_time), queue:false }) } if( $obj.getYdir() < 0 ) { $obj.animate({ top: ( pan_y )},{ duration:(1000 * pan_y_time), queue:false }) } else { $obj.animate({ top: "0" },{ duration:(1000 * pan_y_time), queue:false }) } } }); //-------------- end cycle plugin with panning effect });
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.30 / 8
66 Votes
http://codebin.yi.org/618
page generated in 0.01 seconds