Skip to content

Instantly share code, notes, and snippets.

@celticwebdesign
Created February 13, 2016 22:34
Show Gist options
  • Save celticwebdesign/9621b69aa67a7b6a1212 to your computer and use it in GitHub Desktop.
Save celticwebdesign/9621b69aa67a7b6a1212 to your computer and use it in GitHub Desktop.
Fancybox open on page load
JS ----
(function ($, root, undefined) {
$(function () {
if ($('body.home').length > 0 ) {
$.fancybox({
'width': '100%',
'height': '100%',
'autoScale': true,
'transitionIn': 'fade',
'type': 'inline',
'href': '#popup'
});
}
});
})(jQuery, this);
CSS ----
// Competition Valentines 2016
// if( $('body.valentines-day-win-a-bottle-of-bubby-and-a-50-voucher').length > 0 ) {
// var type = window.location.hash.substr(1);
// if( type == "competition" ) {
// $('html, body').animate({
// scrollTop: $("#mc_embed_signup").offset().top
// }, 2000);
// }
// }
Used for scrolling the page on load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment