欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

css: hide or dispaly div

程序员文章站 2022-06-24 09:45:08
六福会员 X ......
<!doctype html>
<html>
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit" />
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
    <title>六福会员</title>
	<meta name="author" content="geovindu,geovin du,geovindu,涂聚文"/>
     <link href="css/css.css" rel="stylesheet" type="text/css" />
       <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

<style type="text/css">
html {-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;}
/* 取消链接高亮  */
body,div,ul,li,ol,h1,h2,h3,h4,h5,h6,input,textarea,p,dl,dt,dd,a,img,button,form,table,th,tr,td,tbody,article,
aside, details,figcaption,figure,footer,header,hgroup, menu,nav,section{ -webkit-tap-highlight-color:rgba(0, 0, 0, 0); }
/* 设置html5元素为块 */
article, aside, details,figcaption,figure,footer,header,hgroup, menu,nav,section {display: block;}
/* 图片自适应 */
img{max-width: 100%;height: auto;width:auto\9; /* ie8 */-ms-interpolation-mode:bicubic;/*为了照顾ie图片缩放失真*/}
/*取消chrome表单自动填充颜色*/
html{height: 100%;font-size: 16px;}
body{height: 100%;color: #fff;line-height:1.5;
	font-family: "helvetica neue", helvetica, arial,tahoma,"microsoft yahei", "pingfang sc", "hiragino sans gb", "heiti sc", "wenquanyi micro hei", sans-serif;}
body,ul,li,ol,h1,h2,h3,h4,h5,h6,textarea,select,p,dl,dt,dd,a,img,button,form,table,th,tr,td,tbody,article,
aside, details,figcaption,figure,footer,header,hgroup, menu,nav,section{margin:0; padding:0;border:none;}

@media screen and (min-device-width:767px)and (max-device-width: 2768px){
	.main{padding-top: 0;}
	.main{width: 90%;padding: 0;text-align: left;}
	.tbmain{width: 600px;}
	.lblsuccess{width:600px; padding-left:50px; padding-right:50px; left:10px;margin-left:20px}
	.foo{width:50px;  margin-left:0px; text-align:left;font-size: 14px;height: 24px;}
	
}

@media screen and (min-device-width:575px) and (max-device-width: 768px)
{
	.main{padding-top: 0;}
	.main{width: 90%;padding: 0;text-align: left;}
	.tbmain{width: 500px;}
    .lblsuccess{ width:500px; padding-left:50px;padding-right:50px; left:10px;margin-left:20px}
    .foo{width:50px; margin-left:0px; text-align:left;font-size: 14px;height: 24px;}
   
}

@media screen and (min-device-width: 375px) and (max-device-width: 500px) and (-webkit-min-device-pixel-ratio: 2) {
 	.main{padding-top: 0;}
	.main{width: 90%;padding: 0;text-align: left;}
	.tbmain{width: 400px;}
    .lblsuccess{width:400px; padding-left:50px;padding-right:50px; left:10px; margin-left:20px}
    .foo{width:50px; margin-left:0px; text-align:left;font-size: 14px;height: 24px;}
    
}

.txttel
{
    margin:0;padding:4px 8px;float:left;background:#eee;border:medium none;border-radius:2px 0 0 2px;color:#b3b3b3;font-size:13px;height:20px;line-height:20px;width:120px;
}

.ui-datepicker-year{
    display:none;
    }
     .ui-datepicker-daynamesmin{
    display:none;
    } 
  .hidetodaybutton .ui-datepicker-buttonpane .ui-datepicker-current
{
    visibility:hidden;
} 

</style>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
 <script type="text/javascript" language="javascript">

    //var ua = window.navigator.useragent.tolowercase();  
    //return ua.match(/micromessenger/i) == "micromessenger";
    //if(ua.match(/micromessenger/i) == "micromessenger")
    //{
     // alter("weixin");
   // }
	 

	 
	 
   function hidediv()
  {
  

	       //$("#dudialog").hide();
          // $("#dudialog").css('display','none'); 
       var ua = window.navigator.useragent.tolowercase();
	  
      /* var useragent = navigator.useragent.tolowercase();
       if(useragent.indexof('micromessenger') > -1 || useragent.indexof('linux') > -1){
       
        }
       else
       {
            $("#dudialog").hide();
           $("#dudialog").css('display','none'); 
          alter("geovindu1");
       }*/
       if(ua.match(/micromessenger/i) == 'micromessenger'){    
             //判断是否是微信环境       
             //微信环境
            wx.miniprogram.getenv(function(res) {
                 if (res.miniprogram) {
                    // 小程序环境下逻辑 
					 $("#dudialog").css("display","block");										  
					$("#dudialog").show(); 
                }else {
                //非小程序环境下逻辑
                 $("#dudialog").hide();
               }
            })
           
         }
         else
         {
          //非微信环境逻辑
           $("#dudialog").hide();
           $("#dudialog").css('display','none'); 
            alter("geovindu");
        }
   }
	 
 
   $(function(){   
	   
 
     

      //小程序x關閉
   this.closepage.on('click tap', function() { 
    wx.miniprogram.getenv(function(res) { 
     if(res.miniprogram){  //判断小程序环境      
      wwx.miniprogram.navigateto({url: '/pages/index/index'})       
     }    
    })              
   })
   //
    $('.dialog').click(function(){
        		var useragent = navigator.useragent.tolowercase();
			if (useragent.indexof("firefox") != -1 || useragent.indexof("chrome") !=-1) {
 				 window.location.href="about:blank";
			}
			else if(useragent.indexof('android') > -1 || useragent.indexof('linux') > -1){
  				window.opener=null;window.open('about:blank','_self','').close();
			}
			else if(useragent.indexof('micromessenger') > -1 || useragent.indexof('linux') > -1){
  				wx.miniprogram.getenv(function(res) {
                  if (res.miniprogram) {
                      // 走在小程序的逻辑
					  $("#dudialog").css("display","block");
					  $("#dudialog").show();
                      alert("geovindu");
                    } 
                else 
                {
                    $("#dudialog").hide();
           			$("#dudialog").css('display','none');
					//微信环境
                    weixinjsbridge.call('closewindow');
                }
			});//微信小程序
			}
			else {
				 	$("#dudialog").hide();
                  	$("#dudialog").css('display','none');
  					window.opener = null;
  					window.open("about:blank", "_self");
 					window.close();
 				} 
	
	
});

   //js监听手机端浏览器的后退按钮的事件方法
   pushhistory();
    window.addeventlistener("popstate", function(e) {
    //alert("返回操作,会造成重复发送密码短信!");//根据自己的需求实现自己的功能
    //window.open('https://www.lukfook.com/sc/customer-centre/vip-zone/vip-login/');
    window.open('http://www1.lukfook.com.hk/lukfookvip_sc/vipfindpasswordsc.aspx');
  }, false);
  
  function pushhistory() {
    var state = {
    title: "title",
    url: "#"
  };
       window.history.pushstate(state, "title", "#");
  }
  //pc端浏览器使用jquery监听
  /*
  $(document).ready(function(e) { 
  var counter = 0;
  if (window.history && window.history.pushstate) {
    $(window).on('popstate', function () {
    window.history.pushstate('forward', null, '#');
    window.history.forward(1);
    window.location.href='//kefu.shtml';//跳转到个人中心
  });
}
  window.history.pushstate('forward', null, '#'); //在ie中必须得有这两行
  window.history.forward(1);
});
  */
        //设定日期选择器的相关属性
        var pickeropts = {
         //appendtext: "(yyyy-mm-dd)",
         changemonth: true,
         changeyear: true,
         dateformat: "mm-dd",//yy-mm-dd
        // daynamesmin:["一","二","三","四","五","六","日"],
   		 firstday: 0,
   		nexttext: "下一月",
   		prevtext: "上一月",
   		closetext: "关闭",
   		currenttext: "今天",
    	monthnamesshort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
    	isrtl: false,
    	showbuttonpanel: true,
    	yearrange: "-85:+0"
        };

        //创建日期选择器
        $("#txtbirthday").datepicker(pickeropts);
      });
      
</script>

</head>
<body onload="hidediv()">  
	<div style="color: #000000; width: 50px;height: 20px; background:#000000; "></div>
	<div style="color: #dd0000; width: 50px;height: 20px;background:#dd0000"></div>
	<div style="color: #ffce00; width: 50px;height: 20px;background:#ffce00"></div>
	<div id="dudialog" class="dudialog"  style="z-index: 9999; position: fixed ! important; right: 15px; top: 10px;">
       <a href="#">x</a>
    </div>
</body>
</html>