1

誰でも私を正しい方向に向けることができますか?. . . モバイルでのみオプトイン ポップアップを無効にしようとしています。ポップアップは、arty popup という WordPress プラグインを使用しています。現在、ポップアップはすべてのデスクトップと iPad で完全に機能しますが、問題はモバイルではポップアップの閉じるボタンが画面から外れるため、モバイル デバイスからのみ無効にするコードを見つけようとしていました。

どんなポインタでも大歓迎です。

これはポップアップ.phpです

/* /////////////////////////////////////////////// this final section generates all     the     code that is displayed on the front-end of the WP Theme \\\\\\\\\\\\\\\\\\\\\\\\ */     function arty_popup($args = array(), $content = null) { require 'inc/popup.php'; }

add_action( 'wp_head', 'arty_header' );
function arty_header() { 
global $arty_settings;
$options = $arty_settings;?>
<script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js"type="text          /javascript"></script>
<script type="text/javascript">
$(document).ready( function() {
if (document.cookie.indexOf("arty_popup_cookie1") <= 0) {

loadPopupBox();
}       


$('#wrap-out, #popupBoxClose').click( function() {
unloadPopupBox();

var c_name  =   'arty_popup_cookie';
var value   =   'arty_popup_cookie1';
var exdays  =   <?php echo $options['popup_cookie_time']; ?>;

 var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : ";expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;

});

function unloadPopupBox() {
$('#popup_box').fadeOut(200);
$("#wrap-out").css({    
    "display": "none"  
}); 
}

function loadPopupBox() {
$('#popup_box').fadeIn(200);
$("#wrap-out").css({
    "background": "#000",
    "opacity": "0.7"  
});         
}


});

ポップアップボタン .css

.btn{
color:#FFFFFF;
width:91px;
height:40px;
margin-left:10px;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
font-size:12px;
border:none;
background:url(images/btn.gif) no-repeat top;
cursor:pointer;
}
4

0 に答える 0