我想有一個「去頂」,在新的Facebook時間軸中的iFrame的標籤頁面中的鏈接,儘量選用FB.Canvas.scrollTo如下但不工作。任何指針讚賞!FB.Canvas.scrollTo不是內部的iframe工作了Facebook標籤頁
<body style="overflow: hidden">
<div id="fb-root"></div>
<script>
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
// Init the SDK upon load
window.fbAsyncInit = function() {
FB.init({
appId : 'myAppID',
channelUrl : 'my_channel.html',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
document.getElementById('go_to_top').addEventListener('click', function(){
FB.Canvas.scrollTo(0,0);
});
<div id="goToTop">
<img border=0 src ="aPicForClicking.jpg">
</div>
</body>
感謝您的提示! (沒有足夠的聲望來+!但..) – Hofuzz 2012-05-09 16:55:35