Скрытие всплывайки ВК по крестику

This commit is contained in:
Krivchikov Dmitry 2015-05-28 21:47:25 +03:00
parent 429fb895cf
commit 2040ddf0a8
2 changed files with 16 additions and 10 deletions

View File

@ -20,7 +20,7 @@
<div class="glyphicon glyphicon-user" id="loginButton" onclick="$('#loginModal').modal('show');" title="Войти для добавления точки"></div>
<?php endif; ?>
<a href="https://vk.com/wikipoints" target="_blank"><img src="/img/vkBigLogo.png" style="margin-left: 285px; margin-top: 0px; position: absolute; display: none;" id="vkBigLogo" /><div class="glyphicon" style="line-height: 0;" title="WikiPoints вКонтакте"><img src="/img/b.png?v=2" style="margin-left: -5px; margin-top: 0px; height: 20px;" /></div></a>
<a href="https://vk.com/wikipoints" target="_blank"><img src="/img/vkBigLogo.png" usemap="#vkbutton" style="margin-left: 285px; margin-top: 0px; position: absolute; display: none;" id="vkBigLogo" /><div class="glyphicon" style="line-height: 0;" title="WikiPoints вКонтакте"><img src="/img/b.png?v=2" style="margin-left: -5px; margin-top: 0px; height: 20px;" /></div></a>
</div>
<div id="box">
<span id="boxClose" onclick="closeBox();">&times;</span>
@ -107,19 +107,25 @@
<?= $user ? self::renderPartial('modals/addPoint.php', array('categories' => $categories), true) : '' ?>
<?= self::renderPartial('modals/categories.php', array('categories' => $categories), true) ?>
<?= self::renderPartial('modals/image.php', array(), true) ?>
<map name="vkbutton">
<area onclick="hideBigLogo();" shape="rect" coords="0,0,40,40" style="cursor: pointer" title="Спрятать надолго"/>
<area href="https://vk.com/wikipoints" shape="rect" coords="40,0,230,40" title="Посетить группу в VK - это интересно и полезно!" target="_blank"/>
</map>
<script>
$(document).ready(function () {
if (!$.cookie('doNotShowVkLogo')) {
if ($.cookie('doNotShowVKgroup')) {
$('#vkBigLogo').remove();
} else {
setTimeout(function () {
$('#vkBigLogo').show().animate({'margin-left': "-185px"}, 1500);
}, 10000);
setTimeout(function () {
$('#vkBigLogo').animate({'margin-left': "285px"}, 1500, function () {
$('#vkBigLogo').hide();
$.cookie('doNotShowVkLogo', true, { expires: 100, path: '/' });
});
$('#vkBigLogo').show().animate({'margin-left': "-225px"}, 1500);
}, 15000);
}
})
function hideBigLogo() {
$.cookie('doNotShowVKgroup', true, { expires: 100, path: '/' });
$('#vkBigLogo').animate({'margin-left': "285px"}, 1500, function () {
$('#vkBigLogo').remove();
});
}
</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB