Last active
December 22, 2015 00:00
-
-
Save ryancatalani/6386247 to your computer and use it in GitHub Desktop.
Make Boston.com slideshows a single page.
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
var count = 0; | |
if ($('.fancy-dropdown').length > 0) { | |
count = parseInt($('.pic-story-nav').find('.fancy-dropdown').find('ul').find('li:last').find('a').attr('href').replace('?pg=','')); | |
} else { | |
count = $('.thumbnail').length | |
} | |
var container = ($('.pic-story-content').length > 0) ? '.pic-story-content' : '.image-focused-gallery'; | |
for (var i = 2; i <= count; i++) { | |
var parent = $(container); | |
$.get(window.location.href+"?pg="+i, function(data){ | |
var content = $(data).find(container); | |
content.find('.related-links').replaceWith("<hr style='clear:both'>"); | |
if (container == '.image-focused-gallery') { | |
content.find('.title-bar').hide(); | |
content.find('.thumbnail-navigation').hide(); | |
} | |
content.appendTo(parent); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment