반응형
Slidesjs - 원하는 페이지로 이동시킬때.
http://stackoverflow.com/questions/16043600/refresh-slidejs
$('#SLIDESID').slidesjs({
//...
});
// ... later somewhere else ... //
var currentIndex = $('#SLIDESID').data().plugin_slidesjs.data.current;
//remove active tab
$('#SLIDESID [slidesjs-index="' + currentIndex + '"]').remove();
$('#SLIDESID [data-slidesjs-item="' + currentIndex + '"]').parent().remove();
//reindex tabs
var tabs = $('#SLIDESID [slidesjs-index]');
tabs.each(function(idx, elem){
$(elem).attr('slidesjs-index', idx);
});
//reindex pagination
$('#SLIDESID [data-slidesjs-item]').each(function(idx, elem){
$(elem).attr('data-slidesjs-item', idx);
$(elem).text(idx+1);
});
//tweek plugin data
$('#SLIDESID').data().plugin_slidesjs.data.total = tabs.length;
$('#SLIDESID').data().plugin_slidesjs.data.current--;
//animate to new element by clicking on NEXT
$('#SLIDESID .slidesjs-next').click();
반응형
'프로그래밍 > Script' 카테고리의 다른 글
[javascript] Lineman.js: Stop worrying about workflow configuration (0) | 2015.12.22 |
---|---|
[javascript] Colorify.js: Tiny JavaScript color extractor (0) | 2015.12.22 |
[jQuery] bxSlider - The Responsive jQuery Content Slider (0) | 2015.12.15 |
[javascript] Jump.js: A modern smooth-scrolling library (0) | 2015.12.11 |
[jQuery] Unslider 2.0: An ultra-simple jQuery slider (0) | 2015.12.11 |