Skip to content

Instantly share code, notes, and snippets.

@ryancatalani
Last active December 22, 2015 00:00
Show Gist options
  • Save ryancatalani/6386247 to your computer and use it in GitHub Desktop.
Save ryancatalani/6386247 to your computer and use it in GitHub Desktop.
Make Boston.com slideshows a single page.
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