mirror of
https://ghproxy.net/https://github.com/AlxMedia/blogrow.git
synced 2025-08-27 01:46:10 +08:00
Add temporary js for slider to work
This commit is contained in:
parent
9fe899bbfd
commit
028a14390f
1 changed files with 23 additions and 1 deletions
|
@ -15,7 +15,29 @@
|
|||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_post_format( 'gallery' ) ): // Gallery ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Check if first slider image is loaded, and load flexslider on document ready
|
||||
jQuery(document).ready(function(){
|
||||
var firstImage = jQuery('#flexslider-<?php echo the_ID(); ?>').find('img').filter(':first'),
|
||||
checkforloaded = setInterval(function() {
|
||||
var image = firstImage.get(0);
|
||||
if (image.complete || image.readyState == 'complete' || image.readyState == 4) {
|
||||
clearInterval(checkforloaded);
|
||||
jQuery('#flexslider-<?php echo the_ID(); ?>').flexslider({
|
||||
animation: "fade",
|
||||
slideshow: false,
|
||||
directionNav: true,
|
||||
controlNav: false,
|
||||
pauseOnHover: true,
|
||||
slideshowSpeed: 7000,
|
||||
animationSpeed: 600,
|
||||
smoothHeight: true,
|
||||
touch: false
|
||||
});
|
||||
}
|
||||
}, 20);
|
||||
});
|
||||
</script>
|
||||
<div class="post-format">
|
||||
<?php $images = alx_post_images(); if ( !empty($images) ): ?>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue