Created
June 20, 2020 10:10
-
-
Save xlawok/4750c88cd3e206481d0bf72c4529a610 to your computer and use it in GitHub Desktop.
Create carousel slider of instagram feed with wp plugin "Instagram Feed by 10Web" and JS "tiny 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
var insta_loaded_once=false; | |
if(jQuery('.wdi_feed_wrapper').length){ | |
jQuery('#wdi_feed_0').on('wdi_feed_loaded',function(){ | |
setTimeout(function(){ | |
if(insta_loaded_once==false){ | |
var slider_insta = tns({ | |
container: '.wdi_feed_wrapper', | |
items: 1, | |
slideBy: 'page', | |
autoplay: false, | |
mouseDrag: true, | |
nav: false, | |
// lazyload: true, | |
// lazyloadSelector: '.other-lazy', | |
speed: 600, | |
controlsText: ['',''], | |
gutter: 20, | |
responsive: { | |
640: { | |
edgePadding: 20, | |
gutter: 20, | |
items: 2 | |
}, | |
768: { | |
gutter: 30, | |
items: 3 | |
}, | |
1200: { | |
gutter: 40, | |
items: 4 | |
}, 1366: { | |
gutter: 30, | |
items: 5 | |
} | |
} | |
}); | |
insta_loaded_once=true; | |
// could not overwright this class width of image settings so sould remove it | |
jQuery('.wdi_feed_item').removeClass('wdi_feed_item'); | |
} | |
else{ | |
slider_insta.destroy(); | |
slider_insta = slider_insta.rebuild(); | |
// could not overwright this class width of image settings so sould remove it | |
jQuery('.wdi_feed_item').removeClass('wdi_feed_item'); | |
} | |
},1500); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment