나는 내 사이트의 상단에 스크롤 짹짹 바를 통합하려고하고 있으며, 지금까지 동일한 자료를 따르는 것처럼 보이는 여러 가지 자습서를 따라 왔지만 작동시키지 못했습니다. 어떻게됩니까가로 스크롤 짹짹
는 설비가 표시되지만 누군가가 올바른 방향으로하시기 바랍니다에 찔러을 제공 할 수있다 "로드"나는 모든 코드를 잘 설정되어 있다고 생각하지만, 내가 뭔가를 누락 될 수 있습니다 말한다입니까?
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script>
<script src='js/jquery.marquee.js'></script>
<script type='text/javascript'>
//<![CDATA[
var Twitter = {
init: function() {
// Pass in the username you want to display feeds for
this.insertLatestTweets('GumBumRadio');
},
// This replaces the <p>Loading...</p> with the tweets
insertLatestTweets: function (username) {
var limit = 5; // How many feeds do you want?
var url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=GumBumRadio' + username + '&count=' + limit + '&callback=?';
// Now ajax in the feeds from twitter.com
$.getJSON(url, function (data) {
// We'll start by creating a normal marquee-element for the tweets
var html = '<marquee behavior="scroll" scrollamount="1" direction="left">';
// Loop through all the tweets and create a link for each
for (var i in data) {
html += '<a href="http://twitter.com/' + username + '#status_' + data[i].id_str + '">' + data[i].text + ' <i>' + Twitter.daysAgo(data[i].created_at) + '</i></a>';
}
html += '</marquee>';
// Now replace the <p> with our <marquee>-element
$('#twitter p').replaceWith(html);
// The marquee element looks quite shite so we'll use Remy Sharp's plug-in to replace it with a smooth one
Twitter.fancyMarquee();
});
},
// Replaces the marquee-element with a fancy one
fancyMarquee: function() {
// Replace the marquee and do some fancy stuff (taken from remy sharp's website)
$('#twitter marquee').marquee('pointer')
.mouseover(function() {
$(this).trigger('stop');
})
.mouseout(function() {
$(this).trigger('start');
})
.mousemove(function (event) {
if ($(this).data('drag') == true) {
this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
}
})
.mousedown(function (event) {
$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
})
.mouseup(function() {
$(this).data('drag', false);
});
},
// Takes a date and return the number of days it's been since said date
daysAgo: function (date) {
// TODO: Fix date for IE...
if ($.browser.msie) {
return '1 day ago';
}
var d = new Date(date).getTime();
var n = new Date().getTime();
var numDays = Math.round(Math.abs(n - d)/(1000 * 60 * 60 * 24));
var daysAgo = numDays + ' days ago';
if (numDays == 0) {
daysAgo = 'today';
}
else if (numDays == 2) {
daysAgo = numDays + ' day ago';
}
return daysAgo;
}
};
Twitter.init();
//]]>
</script>
는 특정 오류 메시지에 대한 귀하의 브라우저 콘솔 창에서 보라. – DaveHogan
많은 감사합니다, 그리고 볼 것입니다 – Ben
아니, 아니 오류, 여기 링크입니다, 당신은 어떻게 볼 수있는 그걸 아무것도 안하고있어 .http : //www.bella-web.co.uk/GumBumRadio2013/index.html – Ben