-
-
Save anonymous/9133331 to your computer and use it in GitHub Desktop.
anything slider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'attachment', | |
'numberposts' => null, | |
'post_status' => null, | |
'post_parent' => $post->ID, | |
'orderby' => 'menu_order ID', | |
); | |
$attachments = get_posts($args); | |
if ($attachments) {?> | |
<div id="slider" class="slider"> | |
<?php | |
$i = 1; | |
foreach ($attachments as $attachment) { | |
//echo apply_filters('the_title', $attachment->post_title); | |
$image = wp_get_attachment_image_src( $attachment->ID, 'full' ); ?> | |
<div> | |
<img class="check" src="<?php echo get_template_directory_uri() ?>/js/timthumb.php?src=<?php echo $image[0] ?>&w=610" /> | |
</div> | |
<?php | |
$i++; | |
} ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
$('#slider').anythingSlider({ | |
hashTags : false, | |
expand : true, | |
autoPlay : true, | |
resizeContents : false, | |
pauseOnHover : true, | |
buildArrows : false, | |
buildNavigation : false, | |
delay : <?php echo $data['pausetime'] ?>, | |
resumeDelay : 0, | |
animationTime : <?php echo $data['anispeed'] ?>, | |
delayBeforeAnimate:0, | |
easing : 'easeInOutQuint', | |
onSlideBegin : function(e, slider) { | |
$('.nextbutton').fadeOut(); | |
$('.prevbutton').fadeOut(); | |
}, | |
onSlideComplete : function(slider) { | |
$('.nextbutton').fadeIn(); | |
$('.prevbutton').fadeIn(); | |
} | |
}) | |
$('.blogsingleimage').hover(function() { | |
$(".slideforward").stop(true, true).fadeIn(); | |
$(".slidebackward").stop(true, true).fadeIn(); | |
}, function() { | |
$(".slideforward").fadeOut(); | |
$(".slidebackward").fadeOut(); | |
}); | |
$(".pauseButton").toggle(function(){ | |
$(this).attr("class", "playButton"); | |
$('#slider').data('AnythingSlider').startStop(false); // stops the slideshow | |
},function(){ | |
$(this).attr("class", "pauseButton"); | |
$('#slider').data('AnythingSlider').startStop(true); // start the slideshow | |
}); | |
$(".slideforward").click(function(){ | |
$('#slider').data('AnythingSlider').goForward(); | |
}); | |
$(".slidebackward").click(function(){ | |
$('#slider').data('AnythingSlider').goBack(); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment