Skip to content

Instantly share code, notes, and snippets.

@Webbist-dev
Created April 21, 2016 11:27
Show Gist options
  • Save Webbist-dev/446d3fff1e3aabd511db005daa7103f0 to your computer and use it in GitHub Desktop.
Save Webbist-dev/446d3fff1e3aabd511db005daa7103f0 to your computer and use it in GitHub Desktop.
Direct Blinds Code
var oldSiteHtml = '<div class="fixed-banner" style="background:#4EA99E;"><div class="container" style="max-width:984px;"><p>lorem ipsum sit dolor amet concecutor <a href="#" id="newSite" class="fixed-banner-button-old">Go to the new site</a><a href="#" id="dismiss" class="fixed-banner-button-old">Dismiss</a></p></div></div>';
$(oldSiteHtml).prependTo('body');
var newSiteHtml = '<div class="fixed-banner" style="background:#166158;"><div class="container" style="max-width:1024px;"><p>lorem ipsum sit dolor amet concecutor <a href="#" id="oldSite" class="fixed-banner-button-new">Go back to the old site</a><a href="#" id="dismiss" class="fixed-banner-button-new">Dismiss</a></p></div></div>';
$(newSiteHtml).prependTo('body');
$('body').on('click', '#dismiss', function() {
$(this).closest('.fixed-banner').hide();
});
// Styles
.fixed-banner {
position:fixed;
bottom:0;
left:0;
right:0;
z-index:999;
text-align:center;
padding:30px;
color:white;
}
.fixed-banner .container {
margin:0 auto;
}
.fixed-banner-button-new,
.fixed-banner-button-old, {
padding:5px 10px;
text-align:center;
display:inline-block;
font-weight:bold;
margin:0 15px;
background:white;
}
.fixed-banner-button-new {
color:#166158;
}
.fixed-banner-button-new:hover {
background:#166158;
color:#fff;
}
.fixed-banner-button-old {
color:#4EA99E;
}
.fixed-banner-button-old:hover {
background:#4EA99E;
color:#fff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment