Bu kod çalışmadığı için jquery$.cookie ile günde 1 kez gösterilmesini istedim.
Fakat kodu doğru olarak çalıştıramadım. Divin günde 1 kez gösterilmesini istiyorum. Yardımcı olabilir misiniz? Ne şekilde düzenlemeliyim.
<div class="inline-install" style="">
Google Chrome ve Yandex Browser Eklentisi
<a href="#" class="install" onclick="chrome.webstore.install(); "></a>
<a href="#" class="close"> </a>
</div>
<script type="text/javascript">
$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());
if($.browser.chrome) {
// is chrome
} else {
$('.inline-install').hide();
$(".inline-install").html( "display:none" );
}
// Kontrol
$(function(){
if ($.browser.chrome) {
var shouldSuppress = get_cookie('suppress_chrome_inline_install');
if (shouldSuppress != 'yes') {
$('.inline-install').show();
$.cookie('suppress_chrome_inline_install', 'the_value', { expires: 1 }); // 1 gün cookie oluştur
}
else{
$('.inline-install a.close').click(function (event) {
event.preventDefault();
$('.inline-install').remove();
return false;
set_cookie('suppress_chrome_inline_install', 'yes', 30, '/', '', '');
});
}
}
});
$(".inline-install a.close").click(function () {
$(this).slideUp();
$('.inline-install').remove();
});
setTimeout(function(){
$('.inline-install').remove();
}, 20000);
</script>Not: Arama yaptım fakat verilen örneklerdeki yöntemler ile sonuca varamadım.