Created
December 11, 2013 09:51
-
-
Save xfenix/7907761 to your computer and use it in GitHub Desktop.
Nice jquery warning about old Internet Explorer
This file contains hidden or 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
.old-browsers { | |
position: fixed; | |
top: 0; | |
left: 0; | |
right: 0; | |
background: #FCB3BC; | |
border-bottom: 5px solid #E1A0A8; | |
color: #000; | |
text-shadow: none; | |
text-align: center; | |
padding: 10px 0 15px 0; | |
z-index: 100; | |
font-family: Verdana !important; | |
font-size: 12px; | |
} | |
.old-browsers h2 { | |
margin: 0 0 10px 0; | |
padding: 0; | |
} | |
.old-browsers .underlead { | |
font-size: 10px; | |
margin-top: -10px; | |
margin-bottom: 10px; | |
color: #555; | |
} | |
.old-browsers p { | |
margin-bottom: 10px; | |
line-height: 18px; | |
} | |
.old-browsers a { | |
color: #000; | |
font-weight: bold; | |
border-bottom: 1px solid #000; | |
} | |
.old-browsers a:hover { | |
color: #fff; | |
border-bottom-color: #fff; | |
} | |
.old-browsers-iwanttosee { | |
margin-top: 15px; | |
} | |
.old-browsers-iwanttosee a { | |
color: #000; | |
border-bottom: 1px dashed #000; | |
} | |
.old-browsers-iwanttosee a:hover { | |
color: #fff; | |
border-bottom: 1px dashed #fff; | |
} |
This file contains hidden or 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
(function(){ | |
var COOKIE_DAYS_TTL = 7; | |
$(function() { | |
var message = $('<div />') | |
.addClass('old-browsers') | |
.append( | |
$('<div />') | |
.addClass('old-browsers-text') | |
.html( | |
'<h2>Ваш браузер очень сильно устарел</h2>\ | |
<div class="underlead">К сожалению, мы прекратили его поддержку</div>\ | |
<p>Пожалуйста, либо обновите браузер, либо\ | |
скачайте <a href="http://www.google.com/intl/ru/chrome/browser/" target="blank">chrome</a>, \ | |
<a href="http://www.mozilla.org/ru/firefox/new/#download-fx" target="blank">firefox</a>, \ | |
<a href="http://www.opera.com/download/guide/" target="blank">opera</a>, \ | |
<a href="http://support.apple.com/downloads/#safari" target="blank">safari</a>, либо \ | |
любой другой современный браузер.</p>\ | |
<p>Если у же вас Internet Explorer старше 8 версии, а вы\ | |
вы видите это сообщение,<br />\ | |
то отключите режим совместимости (выглядит как разорванная пополам страница).</p>\ | |
<p class="center">Спасибо.<br />\ | |
Мы приносим свои извинения за доставленные неудобства.</p>' | |
) | |
) | |
.append( | |
$('<div />') | |
.addClass('old-browsers-iwanttosee') | |
.append( | |
$('<a />') | |
.attr('href', '#') | |
.html('Закрыть и больше не показывать уведомление') | |
.on( | |
'click', | |
function(e) { | |
$.cookie( | |
'oldbrowserwarned', | |
'dontwantupdate', | |
{ | |
expires: COOKIE_DAYS_TTL, | |
path: '/' | |
} | |
); | |
message.fadeOut(); | |
e.preventDefault(); | |
} | |
) | |
) | |
); | |
$('body').append(message); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment