Created
August 25, 2014 15:01
-
-
Save chetan/269880c14f861e99b517 to your computer and use it in GitHub Desktop.
bookmarklet for single-page slideshows
This file contains 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
// bookmarklet | |
javascript:var d = $("div.slide"), s = $($.grep($("script"), function(el) { return $(el).text().match(/VVMSlideShow/) })).text().replace(/\s+/g, "");s = s.substring(s.indexOf("photoData:")+10, s.indexOf("pointer:")-1);s = JSON.parse(s);_.each(s, function(v, i) {if (i === "1") return;d.append("<img src='" + v["Photo"] + "' />");}); | |
// expanded version | |
var d = $("div.slide"), | |
s = $($.grep($("script"), function(el) { return $(el).text().match(/VVMSlideShow/) })).text().replace(/\s+/g, ""); | |
s = s.substring(s.indexOf("photoData:")+10, s.indexOf("pointer:")-1); | |
s = JSON.parse(s); | |
_.each(s, function(v, i) { | |
if (i === "1") return; | |
d.append("<img src='" + v["Photo"] + "' />"); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment