Created
February 20, 2020 12:20
-
-
Save simple17/cbe51faaf0228e00a08d5c02108bae86 to your computer and use it in GitHub Desktop.
[Vimeo Thumbs] #vimeo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function vimeoLoadingThumb(id) { | |
var url = "http://vimeo.com/api/v2/video/" + id + ".json?callback=showVimeoThumb"; | |
var id_img = "#vimeo-" + id; | |
var script = document.createElement('script'); | |
script.src = url; | |
$(id_img).before(script); | |
} | |
function showVimeoThumb(data) { | |
var id_img = "#vimeo-" + data[0].id; | |
var id_nav_img = "#vimeo-nav-" + data[0].id; | |
$(id_img).attr('src', data[0].thumbnail_large); | |
$(id_nav_img).css('background-image', 'url(' + data[0].thumbnail_medium + ')'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment