문제

Well s the title says I just want to use the facebook cover as background for some div in a website, so whenever I update my cover it automatically updates the image on the site.

in another thread somebody said that was really easy, but I donut have the skills in jQuery to do the code can someone help me with this?

The mentioned thread: How to setup Facebook Timeline Cover Photo website . is it easy for a basic web developer?

Thanks in advance

도움이 되었습니까?

해결책

Just replace MY_FACEBOOK_URL_NAME with whatever yours is or your graph user id number.

$.getJSON('http://graph.facebook.com/MY_FACEBOOK_URL_NAME?fields=cover&callback=?', function(data){
    $('#myDiv').css('background-image','url(' + data.cover.source + ')');
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top