我正在将 Youtube 视频提取到具有下一个和上一个按钮的轮播中。我还添加了演示链接..
如何更改“下一个”和“上一个”按钮的标题、描述、总浏览量?
<script type="text/javascript">
$(document).ready(function(){});
var playListURL = 'http://gdata.youtube.com/feeds/api/playlists/cZxy-GpHLCQ_Ss9sGJfWhzBAIOMDYxMN?v=2&alt=json&callback=?';
var videoURL= 'http://www.youtube.com/watch?v=';
$.getJSON(playListURL, function(data) {
var list_data="";
$.each(data.feed.entry, function(i, item) {
var feedTitle = item.title.$t;
var feedURL = item.link[1].href;
var fragments = feedURL.split("/");
var videoID = fragments[fragments.length - 2];
var url = videoURL + videoID;
var thumb = "http://img.youtube.com/vi/"+ videoID +"/default.jpg";
list_data += '<div><a href= "#" title="'+ feedTitle +'"><img src="'+ thumb +'" width="213px" height="141px"/></a></div>';
});
$(list_data).appendTo(".slides");
$('.carousel').carousel({carouselWidth:930,carouselHeight:330,directionNav:true,shadow:true,buttonNav:'bullets'});
var cnt = 0;
$(".nextButton").click(function () {
var len = $(this).siblings(".slides").children(".slideItem").length;
var a = cnt++;
});
});
</script>