2016-06-22 12 views
1

これがTumblrで可能かどうかは分かりません。私が持っているポップアップは「fancybox」ではありません。私はここで解決策を見つけることを試みたが、私は多くの運がなかった。私は訪問者が私のブログに来るときに表示されるポップアップボックスを持っていますが、次のページをクリックするたびに再びポップアップします。誰かがリフレッシュするたびにポップアップしたくない。私はそれが欲しいので、ユーザーごとに7日に1回ポップし、それらには「メッセージをもう一度表示しない」オプションがあります。ポップアップ 'このメッセージをもう一度表示しない'オプション

これはスクリプトです。

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js"> </script> 

<script> 
$(document).ready(function() { 

var id = '#dialog'; 


//Get the screen height and width 
var maskHeight = $(document).height(); 
var maskWidth = $(window).width(); 


//Set heigth and width to mask to fill up the whole screen 
$('#mask').css({'width':maskWidth,'height':maskHeight}); 

//transition effect 
$('#mask').show(1000); 
$('#mask').fadeTo("slow",0.5); 

//Get the window height and width 
var winH = $(window).height(); 
var winW = $(window).width(); 

//Set the popup window to center 
$(id).css('top', winH/2-$(id).height()/2); 
$(id).css('left', winW/2-$(id).width()/2); 

//transition effect 
$(id).show(2000); 

//if close button is clicked 
$('.window .close').click(function (e) { 
//Cancel the link behavior 
e.preventDefault(); 


$('#mask').hide(); 
$('.window').hide(); 
}); 


//if mask is clicked 
$('#mask').click(function() { 
$(this).hide(); 
$('.window').hide(); 
}); 




}); 

</script> 

これは、あなたが、ユーザーがポップアップを見ているかを追跡できるように、あなたのウェブサイト上でクッキーやセッションを使用する必要があります閉じるボタン

<a href="#" title="close" class="close"><div class="rotating" style="margin- left:395px; margin-top:-25px; position:absolute;"><big>✦</big> </div></a><br><br> 

答えて

3

です。

この場合、おそらくHTML5ウェブストアをお勧めします。

HTML Local Storage

あなたは、あなたは、ユーザーのポップアップを表示する前に毎回確認するか、設定することができます有効期限を使用して、ポップアップに関連するアイテムを格納することができます。

これが役に立ちます。

+0

私はそれが動作すると思う!ありがとうございました ! – Brick

関連する問題