Skip to content

Instantly share code, notes, and snippets.

@kerstvo
Created July 16, 2015 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerstvo/55d5ccf43ae27aee07ec to your computer and use it in GitHub Desktop.
Save kerstvo/55d5ccf43ae27aee07ec to your computer and use it in GitHub Desktop.
// Countdown section
var $countdown_section = $('<section class="clearfix" style="padding: 50px 0;">' +
'<div class="row">' +
' <div class="col-sm-8" style="padding-top: 17px;">' +
' <div class="col-sm-6 col-md-3 text text-center" style="padding: 0;">Order within</div>' +
' <div class="col-sm-6 col-md-3 countdown" style="padding: 0;"></div>' +
' <div class="col-md-6 text text-center" style="padding: 0;">for delivery by <span class="delivery-date"></span></div>' +
' </div>' +
' <div class="col-sm-4 buy-btn"></div>' +
'</div>' +
'</section>').insertAfter($secure_section);
$countdown_section.find('.countdown-period').css({
'margin-top': '5px'
});
$countdown_section.find('.delivery-date span').css({
'color': '#999999',
'font-size': '23px',
'font-weight': 'normal'
});
$countdown_section.find('.text').css({
'color': '#999999',
'font-size': '23px'
});
$countdown_section.find('.buy-btn').append($buybtn.clone());
window.countdown_Interval = setInterval(function() {
if ($('#countdown').length > 0) {
$('#countdown')
.parents('.row.hidden-xs').next().remove()
.end().removeClass('hidden-xs').css('display', 'none');
$countdown_section.find('.countdown').css({
'font-size': '9px'
}).append($('#countdown'));
$countdown_section.find('.delivery-date').append($('.product--delivery span:last'));
clearInterval(window.countdown_Interval);
}
}, 50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment