太阳神庙,圆顶礁国家公园, 犹他州, 美国 (© Austin Cronnelly/TANDEM Stills + Motion)

Welcom to 评论 - lizhenqiu blog!

    #666

    作者:广西南宁市
    手机网站二级栏目自动居中
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" /> <meta name="format-detection" content="telephone=no" /> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.9.0/jquery.min.js"></script> <ul class="clearUl" id="menuullidemoli"> <li>范德萨发达省份</li> <li>32432</li> <li>34</li> </ul> <script> (function (d){ $(d).css('clear','both'); var nw; var t=0; $(d+' li').each(function(){ $(this).css('display','inline-block'); nw=$(this).width(); t=t+nw; }); var pw=$(d).width(); //console.log(pw); if(pw<t){ $(d+' li').each(function(){ $(this).css('float','left'); }); }else{ $(d).css('textAlign','center'); } })("#menuullidemoli"); //ul id </script>
    Run code
    Cut to clipboard
      文章:常用html、demo代码  发表时间:2018-01-15, 15:34:24  
      展开↯

      #667

      作者:广西南宁市
      this.setData() 异步回调
      this.setData({userInfo: userInfo}, callback)
      Run code
      Cut to clipboard

        */ onLoad: function (options) { var that = this; App.editTabBar(that); // var ajaxdata //console.log(that.data); var url = 'https://ssl.resonance.net.cn/test/index.php/Home/About/index'; util.ntime(utilMd5, that, url, "calll"); }, calll: function (that,res){ //console.log(res.content) WxParse.wxParse('article', 'html', res.content, that, 5); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { function updatenew(url, token, that, calll) { that.setData(res.data, that.calll(that,res.data))
        Run code
        Cut to clipboard
          #,广西南宁市,2018-01-06,17:23:18,
          setTimeout(回调函数,时间,参数1,...,参数n)
          Run code
          Cut to clipboard
            #,广西南宁市,2018-01-15,14:54:11,
            文章:微信小程序开发笔记  发表时间:2018-01-06, 17:19:13  
            展开↯

            #668

            作者:广西
            #,广西南宁市,2018-01-15,03:59:54,
            #,广西南宁市,2018-01-15,04:00:55,
            文章:一个制片人的自白  发表时间:2018-01-10, 04:07:49  
            展开↯

            #669

            作者:广西南宁市
            用一个div模拟成body,然后footer放这个模拟div外,然后margin-top负值把footer拉上去
            #,广西南宁市,2017-05-31,17:49:13, 这些是CSS3特有的选择器,
            A>B 表示选择A元素的所有子B元素。
            与A B的区别在于,A B选择所有后代元素,而A>B只选择一代。
            另外:没有<的用法。
            A+B表示HTML中紧随A的B元素。
            nth-child是个伪类的用法,如p:nth-child(2)就表示在p的父元素中选择位居第二位的p,这个可能不太好理解,自己试一试就知道了。
            #,广西南宁市,2017-05-31,17:51:09, text-align实现div水平垂直居中
            <style>.parent { text-align:center; margin:0 auto; width:200px; height:200px; background:red; } .children { positiona;absolute; margin-top:75px; width:50px; height:50px; background: black; display:inline-block;/*使其父元素text-align生效*/ }</style><div class="parent"> <div class="children"></div> </div>
            Run code
            Cut to clipboard
              #,广西南宁市,2018-01-12,16:53:39,
              图片黑白css 使用CSS将图片转换成黑白(灰色、置灰) CSS3 Filter 去色
              <style> img{ -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: grayscale(100%); filter: gray;} img:hover{-webkit-filter: grayscale(0); -moz-filter: grayscale(0); -ms-filter: grayscale(0); -o-filter: grayscale(0); filter: grayscale(0); filter: gray(0); } </style> <img src="VCG21gic16069628.jpg">
              Run code
              Cut to clipboard
                文章:常用html、demo代码  发表时间:2016-02-03, 16:31:50  
                展开↯

                #670

                作者:广西
                手机宽度超过多行滚动
                文章:@意见反馈/技术支持/伊网/安企网  发表时间:2018-01-10, 04:08:37  
                展开↯

                #671

                作者:广西
                葛优:我让你白刀子进,黄刀子出,我挑你屎包~ 我在让你白刀子进,绿刀子出,我扎你苦胆~ 我还让你白刀子进,还是白刀子出,我戳你脑浆子~
                文章:一个制片人的自白  发表时间:2018-01-10, 04:06:39  
                展开↯

                #672

                作者:广西南宁市
                C:WINDOWS/system32/drivers/etc 目录下的 hosts
                #,广西南宁市,2018-01-05,17:55:37,
                a链接href执行js代码
                <a href = "javascript:alert(22);">点我</a>
                Run code
                Cut to clipboard

                  去掉a链接点击
                  href="javascript:;"
                  Run code
                  Cut to clipboard

                    或者去掉href属性
                    #,广西南宁市,2018-01-09,11:06:21,
                    view-source:URL
                    Run code
                    Cut to clipboard
                      #,广西南宁市,2018-01-09,15:26:40,
                      nofollow有两种用法: 1.用于meta元标签:<meta name="robots" content="nofollow" />,告诉爬虫该页面上所有链接都无需追踪。 2.用于a标签:<a href="login.aspx" rel="nofollow">登录</a>,告诉爬虫该页面无需追踪。
                      Run code
                      Cut to clipboard
                        文章:常用html、demo代码  发表时间:2015-12-18, 11:01:52  
                        展开↯

                        #673

                        作者:广西南宁市
                        for循环最基础的知识做的九九乘法表
                        <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> #box div{ width: 80px; display: inline-block; background-color: gray; } #box div span{ display: block; line-height: 30px; color: pink; background-color:black; margin-right: 2px; text-align: center; } </style> </head> <body> <div id="box"> <!--<div> <span> 1 X 1 = 1 </span> <span> 1 X 2 = 2 </span> <span> 1 X 3 = 3 </span> <span> 1 X 4 = 4 </span> <span> 1 X 5 = 5 </span> <span> 1 X 6 = 6 </span> <span> 1 X 7 = 7 </span> <span> 1 X 8 = 8 </span> <span> 1 X 9 = 9 </span> <span> 1 X 10 = 10 </span> </div> <div> <span> 2 X 2 = 4 </span> <span> 2 X 3 = 6 </span> <span> 2 X 4 = 8 </span> <span> 2 X 5 = 10 </span> <span> 2 X 6 = 12 </span> <span> 2 X 7 = 14 </span> <span> 2 X 8 = 16</span> <span> 2 X 9 = 18 </span> <span> 2 X 10 = 20 </span> </div> ......--> </div> <script> var box = document.getElementById('box') var str = '' //i是列数j是乘号后面的数,是第几列,成号后面的数就是几开始 for( var i = 1; i < 10; i ++){ str += '<div>' //console.log(str) for( var j = i; j < 10; j ++){ var n = i + 'X' + j + '=' + i*j str += '<span>' + n + '</span>' } str += '</div>' } box.innerHTML = str </script> </body> </html>
                        Run code
                        Cut to clipboard

                          <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style > #box div{ color: deeppink; } #box div span{ padding: 5px; line-height: 20px; width: 70px; display: inline-block; border:1px solid peru; background-color: goldenrod; } </style> </head> <body> <div id="box"> <!--<div> <span> 1 X 1 = 1 </span> <span> 1 X 2 = 2 </span> <span> 1 X 3 = 3 </span> <span> 1 X 4 = 4 </span> <span> 1 X 5 = 5 </span> <span> 1 X 6 = 6 </span> <span> 1 X 7 = 7 </span> <span> 1 X 8 = 8 </span> <span> 1 X 9 = 9 </span> <span> 1 X 10 = 10 </span> </div> <div> <span> 2 X 2 = 4 </span> <span> 2 X 3 = 6 </span> <span> 2 X 4 = 8 </span> <span> 2 X 5 = 10 </span> <span> 2 X 6 = 12 </span> <span> 2 X 7 = 14 </span> <span> 2 X 8 = 16</span> <span> 2 X 9 = 18 </span> <span> 2 X 10 = 20 </span> </div> ......--> </div> <script> var box = document.getElementById('box') var str = '' //i为行,j为列 for( var i = 1; i < 10; i ++){ str += '<div>' //console.log(str) for( var j = 1; j <= i ; j ++ ){ var n = j + 'X' + i + '=' + j*i str += '<span>' + n + '</span>' } str += '</div>' } box.innerHTML = str </script> </body> </html>
                          Run code
                          Cut to clipboard
                            #,广西南宁市,2018-01-09,11:03:18,
                            九九乘法表(点击出现4种)
                            <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> div{ width: 80px; height: 30px; background: #ADFF2F; text-align: center; line-height: 30px; font-size: 20px; color: #FF0000; position: absolute; } </style> </head> <body> </body> <script> var stt=[one,two,three,four]; num =0; document.onclick = function(){ stt[num](); num++; num%=stt.length; }; //第一种 function one(){ var str =''; for(var i=1;i<10;i++){ for(var j=i;j<10;j++){ str +='<div style="left:'+(i-1)*90+'px;top:'+(j-1)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第二种 ////////好别扭 function two(){ var str =''; for(var i=9;i>0;i--){ for(var j=i;j>0;j--){ str +='<div style="left:'+(9-i)*90+'px;top:'+(i-j)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第三种 function three(){ var str =''; for(var i=1;i<10;i++){ for(var j=i;j<10;j++){ str +='<div style="left:'+(9-i)*90+'px;top:'+(j-1)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } //第四种 function four(){ var str=''; for(var i=1;i<10;i++){ for(var j=9;j>i-1;j--){ str +='<div style="left:'+(i-1)*90+'px;top:'+(9-j)*40+'px;">'+i+'X'+j+'='+i*j+'</div>'; } } document.body.innerHTML = str; } /* 因为i<10是一个判断条件,则一直加的话最后数字只能到9 因为j>i-1也是一个判断,而j最大值也是9 所以到最后就会出现9 X 9 */ </script> </html>
                            Run code
                            Cut to clipboard
                              文章:纯CSS鼠标提示工具tooltip.css  发表时间:2018-01-09, 11:02:16  
                              展开↯

                              #674

                              作者:广西南宁市
                              梦想还是要有的,万一睡醒了呢?
                              文章:一个制片人的自白  发表时间:2018-01-09, 09:29:51  
                              展开↯

                              #675

                              作者:广西南宁市
                              易企秀伪静态


                              选择.htaccess
                              Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
                              Run code
                              Cut to clipboard
                                文章:IIS7.5使用web.config设置伪静态的二种方法  发表时间:2018-01-08, 15:35:02  
                                展开↯

                                #676

                                作者:广西南宁市
                                <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>垂直居中Demo</title> <style> #container{ height:300px; background:#d6d6d6; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; justify-content:center; align-items: center; } #center{ width:100px; height:100px; background-color:#666; color:#fff; font-weight:bold; font-size:18px; display:flex; /*这个写在这只是为了#center这几个字的垂直居中*/ justify-content:center; align-items: center; } </style> </head> <body> <div id='container'> <div id = 'center'>#center</div> </div> </body> </html>
                                Run code
                                Cut to clipboard
                                  文章:CSS3实现垂直居中  发表时间:2018-01-06, 17:15:11  
                                  展开↯

                                  #677

                                  作者:广西南宁市
                                  <style> .prm { width:300px; height:300px; background:green; display:table-cell; text-align:center; vertical-align:middle; } </style> <div class="pr" style="display:none"> <p class="c">单行居中 单行居中</p> </div> <div class="prm"> <p class="c"> 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 多行垂直居中 </p> </div>
                                  Run code
                                  Cut to clipboard
                                    文章:CSS3实现垂直居中  发表时间:2018-01-06, 17:12:58  
                                    展开↯

                                    #678

                                    作者:广西南宁市
                                    微信小程序TLS版本必须大于等于1.2
                                    Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Multi-Protocol Unified Hello\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\PCT 1.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client] "DisabledByDefault"=dword:00000001 "Enabled"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server] "Enabled"=dword:00000000 "DisabledByDefault"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "Enabled"=dword:00000001 "DisabledByDefault"=dword:00000000
                                    Run code
                                    Cut to clipboard

                                      双击执行,重启服务器 TLS1.2.reg
                                      文章:免费ssl证书:网站域名使用 https (nginx) 访问配置参考  发表时间:2018-01-06, 11:23:22  
                                      展开↯

                                      #679

                                      作者:广西南宁市
                                      点击切换
                                      var App = getApp(); // pages/about/about.js Page({ /** * 页面的初始数据 */ data: { "content": '广西南宁共振广告有限公司,2008年成立于南宁,是一家以“品牌咨询+品牌设计+品牌策划+品牌落地”于一体的品牌服务平台,通过360°全景式纵深品牌打造,从品牌标识设计、VI设计、空间设计、包装、海报等多维度构建完善的品牌价值链,致力于以实战服务中国企业,以品牌推动中国成长。公司创立至今,已是当之无愧的品牌实战专家,客户涵盖国内外地产、金融、IT、汽车、服装时尚、奢侈品、能源、机械、快速消费品等各行业著名的企业,深受客户信赖。我们坚持以实力深耕市场,力求达成艺术与商业之间、客户与市场之间、虚拟与现实之间的价值共生,将企业打造成为一个能为客户提供综合化', "content2": '更换内容21321', "content3": '2222222222222更换内容21321', radioCheckVal: 0, all: [{ one: "公司介绍", two: '../../images/ab2.gif', two1: '../../images/ab5.gif' }, { one: "公司理念", two: '../../images/ab3.gif', two1: '../../images/ab4.gif' }, { one: "核心优势", two: '../../images/ab4.gif', two1: '../../images/ab3.gif' }, { one: "公司使命", two: '../../images/ab5.gif', two1: '../../images/ab2.gif' }], oall:{ } }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { App.editTabBar(this); this.setData({ "oall": this.data.all })//保存初始图片数据 2018.01.05 }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, //更换内容 getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; // var adata =''; var id = n.currentTarget.dataset.id; //打印可以看到,此处已获取到了包含id、title、和content的对象 var that = this; //var two = all[id].two = all[id].two1; this.setData({ "all":this.data.oall },function(){ that.data.all[id].two = that.data.all[id].two1; //console.log(that.data.all); var all = that.data.all; that.setData({ "content": that.data[ncc], "all": all, "id": id }) }); } })
                                      Run code
                                      Cut to clipboard
                                        #,广西南宁市,2018-01-05,12:22:56,
                                        <!-------------banner 开始--------------> <image style='width:100%;' src='../../images/ab0.png' mode="widthFix" ></image> <!-------------banner 结束--------------> <view class="about" style="background:url('https://hhh.liangtianmei.com/images/bjjj.png');"> <!-------------标题 开始--------------> <view class='title'> <view class='zuo'> <view class='xian'></view> <view class='yuan'>●</view> </view> <view class='wz'> <text class='yw'>ABOUT SU\n</text> <text class='zw'>关于我们\n</text> </view> <view class='you'> <view class='yuan'>●</view> <view class='xian'></view> </view> </view> <!-------------标题 结束--------------> <!-------------导航 开始--------------> <view class='nav'> <view class='meiyi'> <block wx:for="{{all}}"> <view class="dg" bindtap="getnewcontent" data-id="{{index}}" data-c='{{index+1}}' style="{{index == id?' border:1rpx solid red':'border:1rpx solid gainsboro;'}}"> <image src="{{item.two}}" mode="widthFix" data-index="{{index}}"></image> <text>{{item.one}}</text> </view> </block> <!-- <view class='dg' bindtap="getnewcontent" data-c='2'> <image src='../../images/ab2.gif' mode="widthFix"></image>\r\n <text>公司介绍</text> </view> <view class='dg' bindtap="getnewcontent" data-c='3'> <image src='../../images/ab3.gif' mode="widthFix"></image>\r\n <text>公司理念</text> </view> <view class='dg'> <image src='../../images/ab4.gif' mode="widthFix"></image>\r\n <text>核心优势</text> </view> <view class='dg'> <image src='../../images/ab5.gif' mode="widthFix"></image>\r\n <text>公司使命</text> </view>--> </view> </view> <!-------------导航 结束--------------> <!-------------图文 开始--------------> <view class='nr'> <image src='../../images/ab1.png' mode="widthFix"></image> <text>{{content}}</text> </view> <!-------------图文 结束--------------> </view> <import src="../template/tabBar.wxml" /> <template is="tabBar" data="{{tabBar: tabBar}}" />
                                        Run code
                                        Cut to clipboard
                                          #,广西南宁市,2018-01-05,12:23:51,
                                          微信模板文件wxml循坏遍历怎么json键名变量??
                                          #,广西南宁市,2018-01-05,14:15:21,
                                          getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; var id = n.currentTarget.dataset.id; this.setData({ "content": this.data[ncc], id:id }) } <block wx:for="{{all}}"> <view class='dg' data-id="{{index}}" bindtap="getnewcontent" data-c='{{index+1}}'> <block wx:if="{{index==id}}"> <image src='{{item.two1}}' mode="widthFix"></image>\r\n </飙泪ock> <block wx:else> <image src='{{item.two}}' mode="widthFix"></image>\r\n </飙泪ock> <text>{{item.one}}</text> <iew> </飙泪ock>
                                          Run code
                                          Cut to clipboard
                                            #,广西南宁市,2018-01-05,17:57:00,@2, 小程序函数传参
                                            文章:微信小程序开发笔记  发表时间:2018-01-05, 12:22:42  
                                            展开↯

                                            #680

                                            作者:广西南宁市
                                            随机数接口API
                                            https://www.random.org/integers/?num=1&min=100000&max=999999&col=1&base=10&format=plain&rnd=new
                                            Run code
                                            Cut to clipboard
                                              文章:程序员编程常用网页工具集[游戏]  发表时间:2018-01-05, 09:37:38  
                                              展开↯

                                              #681

                                              作者:广西南宁市
                                              <template name="tabBar"> <view class="flex-h flex-hsb tab-bar" style="color: {{tabBar.color}}; background: {{tarBar.backgroundColor}}; {{tabBar.position=='top'? 'top: 0' : 'bottom: 0'}}; {{tabBar.borderStyle? (tabBar.position=='top'? 'border-bottom: solid 1px '+tabBar.borderStyle + ';' : 'border-top: solid 1px '+tabBar.borderStyle + ';') : ''}}"> <block wx:for="{{tabBar.list}}" wx:key="pagePath"> <navigator url="{{item.pagePath}}" open-type="redirect" class="menu-item" style="{{item.active? 'color: '+(item.selectedColor? item.selectedColor : tabBar.selectedColor) : ''}}"> <image src="{{item.selectedIconPath}}" wx:if="{{item.active}}"></image> <image src="{{item.iconPath}}" wx:if="{{!item.active}}"></image> <text style="color:{{item.selectedColor}}" wx:if="{{item.active}}">{{item.text}}</text> <text style="color:{{item.color}}" wx:if="{{!item.active}}">{{item.text}}</text> </navigator> </block> </view> </template>
                                              Run code
                                              Cut to clipboard
                                                文章:微信小程序自定义选项卡tabBar模板底部顶部导航  发表时间:2018-01-04, 17:19:37  
                                                展开↯

                                                #682

                                                作者:广西南宁市
                                                // pages/about/about.js Page({ /** * 页面的初始数据 */ data: { "content": '广西南宁共振广告有限公司,2008年成立于南宁,是一家以“品牌咨询+品牌设计+品牌策划+品牌落地”于一体的品牌服务平台,通过360°全景式纵深品牌打造,从品牌标识设计、VI设计、空间设计、包装、海报等多维度构建完善的品牌价值链,致力于以实战服务中国企业,以品牌推动中国成长。公司创立至今,已是当之无愧的品牌实战专家,客户涵盖国内外地产、金融、IT、汽车、服装时尚、奢侈品、能源、机械、快速消费品等各行业著名的企业,深受客户信赖。我们坚持以实力深耕市场,力求达成艺术与商业之间、客户与市场之间、虚拟与现实之间的价值共生,将企业打造成为一个能为客户提供综合化', "content2": '更换内容21321', "content3": '2222222222222更换内容21321' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, //更换内容 getnewcontent:function(n){ var cc = (n.currentTarget.dataset.c); var ncc ='content'+cc; console.log(ncc); this.setData({ "content": this.data[ncc], }) } })
                                                Run code
                                                Cut to clipboard
                                                  #,广西南宁市,2018-01-04,17:06:34,
                                                  <!-------------banner 开始--------------> <image style='width:100%;' src='../../images/ab0.png' mode="widthFix" ></image> <!-------------banner 结束--------------> <view class="about" style="background:url('https://hhh.liangtianmei.com/images/bjjj.png');"> <!-------------标题 开始--------------> <view class='title'> <view class='zuo'> <view class='xian'></view> <view class='yuan'>●</view> </view> <view class='wz'> <text class='yw'>ABOUT SU\n</text> <text class='zw'>关于我们\n</text> </view> <view class='you'> <view class='yuan'>●</view> <view class='xian'></view> </view> </view> <!-------------标题 结束--------------> <!-------------导航 开始--------------> <view class='nav'> <view class='meiyi'> <view class='dg' bindtap="getnewcontent" data-c='2'> <image src='../../images/ab2.gif' mode="widthFix"></image>\r\n <text>公司介绍</text> </view> <view class='dg'> <image src='../../images/ab3.gif' mode="widthFix"></image>\r\n <text>公司理念</text> </view> <view class='dg'> <image src='../../images/ab4.gif' mode="widthFix"></image>\r\n <text>核心优势</text> </view> <view class='dg'> <image src='../../images/ab5.gif' mode="widthFix"></image>\r\n <text>公司使命</text> </view> </view> </view> <!-------------导航 结束--------------> <!-------------图文 开始--------------> <view class='nr'> <image src='../../images/ab1.png' mode="widthFix"></image> <text>{{content}}</text> </view> <!-------------图文 结束--------------> </view>
                                                  Run code
                                                  Cut to clipboard
                                                    #,广西南宁市,2018-01-04,17:07:20, Javascript中解析json时key为变量
                                                    alert(json.lastMonth[dep]);
                                                    Run code
                                                    Cut to clipboard

                                                      使用中括号的方式就可以用变量key值
                                                      js json键名变量
                                                      js变量名变量
                                                      文章:微信小程序自定义选项卡tabBar模板底部顶部导航  发表时间:2018-01-04, 17:06:21  
                                                      展开↯

                                                      #683

                                                      作者:广西南宁市
                                                      var app = getApp() //构造令牌 // 在需要使用的js文件中,导入js //var util = require('../../utils/util.js'); //构造令牌 使用服务器时间戳 var utilMd5 = require('../../utils/md5.js'); var util = require('../../utils/util.js'); var ttken = 'JLI5vvqq0KRnzfla';//密钥 var ttime = parseInt(Date.parse(new Date()) / 1000);//时间 秒 //var ttime = util.ntime(); var ntoken = ttken + ttime; var token = utilMd5.hexMD5(ntoken); //console.log(token); //end Page({ /** * 页面的初始数据 */ data: { token:0, tokenid: 0 }, onLoad: function () { //console.log('token: ' + token); var params = { 'name': 'json', 'age': 26 }; //util.makeusertoken() //初始化 验证码 util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/code/token/' + token, token,this); //获取验证码图片 var tokenid = wx.getStorageSync('tokenid'); //util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/getcode/token/' + token + '/tokenid/' + tokenid+'/'); this.setData({ token: token, tokenid:tokenid }) }, changing:function(){ util.updatenew('https://hhh.*****.com/index.php/Home/Wxapp/code/token/' + token, token, this); var tokenid = wx.getStorageSync('tokenid'); this.setData({ token: token, tokenid: tokenid }) } }) //ajax(method, url, data, success)
                                                      Run code
                                                      Cut to clipboard


                                                        1.生成令牌 <image style="height:40px;width:100px;margin-top:10px;" bindtap="changing" id="codeyzmm" src="https://hhh.*****.com/index.php/Home/Wxapp/getcode/token/{{token}}/tokenid/{{tokenid}}/" ></image>
                                                        Run code
                                                        Cut to clipboard


                                                          const formatTime = date => { const year = date.getFullYear() const month = date.getMonth() + 1 const day = date.getDate() const hour = date.getHours() const minute = date.getMinutes() const second = date.getSeconds() return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') } const formatNumber = n => { n = n.toString() return n[1] ? n : '0' + n } //服务器时间戳 function ntime(utilMd5, that,url){ wx.request({ url: 'https://hhh.*****.com/ntime.php',//请修改为你服务器 data: { }, header: { 'content-type': 'application/json' }, success: function (res) { //return res; var ttken = 'JLI5vvqq0KRnzfla';//密钥 //var ttime = parseInt(Date.parse(new Date()) / 1000);//时间 秒 var ttime =res.data;//util.ntime(); var ntoken = ttken + ttime; var token = utilMd5.hexMD5(ntoken); //console.log(ntoken); //return token; // var url = 'https://hhh.*****.com/index.php/Home/Product/index'; updatenew(url, token, that); } }) } //更新数据 function updatenew(url, token, that) { wx.request({ url: url,//'https://hhh.*****.com/index.php/Home/Product/index', //仅为示例,并非真实的接口地址 /*data: { token: token },*/ method: 'GET', header: { 'content-type': 'application/json' // 默认值 }, success: function (res) { // alert(res.data) // res.data.content = app.convertHtmlToText(res.content) /*that.setData({ textdata: res.data }); console.log (res.data)*/ // that.setData(res.data) /*that.setData({ all: res.data//第一个data为固定用法,第二个data是json中的data })*/ //console.log(token); //res.data.jzzz = 1; if (res.data.tokenid){ //保存token id wx.setStorageSync('tokenid', res.data.tokenid); } if (that){ that.setData(res.data) //that.setData({ //jzzz:1, //jzzzs:'', //codeimgurl: res.data.codeimgurl, //all: res.data //res // imageUrl: "../images/sp_07.png"//触发事件时的图片 //}) } } }) } //构造令牌 // 在需要使用的js文件中,导入js //var util = require('../../utils/util.js'); /*var ttken ='JLI5vvqq0KRnzfla';//密钥 var ttime = parseInt(Date.parse(new Date())/1000);//时间 秒 //var ttime = util.ntime(); var ntoken=ttken+ttime; var token = utilMd5.hexMD5(ntoken); console.log(token);*/ //end //随机字符窜 function randomString(len) {   len = len || 32; var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhioOLl,9gq,Vv,Uu,I1jkmnprstwxyz/*~!@#¥%……&*()+=-2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/   var maxPos = $chars.length;   var pwd = '';   for (var i = 0; i < len; i++) {     pwd += $chars.charAt(Math.floor(Math.random() * maxPos));   }   return pwd; } //document.write(randomString(32)); /*伪身份凭证*/ function makeusertoken(){ //console.log(randomString(9)) var ro = randomString(9); //存储随机字符1 wx.setStorageSync('ros', ro); //var code = ro.charCodeAt(); //var nro = wx.getStorageSync('ros') //console.log(strToBinary(ro)); //console.log(binaryToStr('1000010 1000010 111000 1101011 1001101 1000000 110001 1101100 1111001')); } //将字符串转换成二进制形式,中间用空格隔开 function strToBinary(str) { var result = []; var list = str.split(""); for (var i = 0; i < list.length; i++) { if (i != 0) { result.push(" "); } var item = list[i]; var binaryStr = item.charCodeAt().toString(2); result.push(binaryStr); } return result.join(""); } //将二进制字符串转换成Unicode字符串 function binaryToStr(str) { var result = []; var list = str.split(" "); for (var i = 0; i < list.length; i++) { var item = list[i]; var asciiCode = parseInt(item, 2); var charValue = String.fromCharCode(asciiCode); result.push(charValue); } return result.join(""); } /*end*/ //获取访问者的openid /*end*/ module.exports = { formatTime: formatTime, ntime: ntime, updatenew: updatenew, makeusertoken: makeusertoken }
                                                          Run code
                                                          Cut to clipboard
                                                            #,广西南宁市,2018-01-04,16:39:16,
                                                            wx.navigateTo({ url: 'test?id=1'//实际路径要写全 })
                                                            Run code
                                                            Cut to clipboard

                                                              //test.js Page({ onLoad: function(option){ console.log(option.id) } })
                                                              Run code
                                                              Cut to clipboard

                                                                参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;
                                                                test?id=1 中id为参数键,1 为参数值
                                                                在目的页面中onLoad()方法中option对象即为参数对象,可以通过参数键来取出参数值
                                                                文章:微信小程序开发笔记  发表时间:2018-01-02, 17:10:08  
                                                                展开↯

                                                                #684

                                                                作者:广西南宁市
                                                                小程序不支持DOM和BOM操作,所有逻辑都需要通过数据驱动
                                                                1.css方案
                                                                <view class="{{isFold ?'flod':'extend' }}" bindtap="flodFn"> 我是一个很长的文字 </view> .flod{ //折叠样式 } .extend{ //展开样式 } flodFn:function(){ this.setData({ isFold: !this.isFold }); }
                                                                Run code
                                                                Cut to clipboard

                                                                  2.动态渲染方案
                                                                  <view bindtap="flodFn"> <view wx:if="{{isFold}}" > 我是一个很长的文字 </view> <view wx:else> 我是一个很长的文字 </view> </view> flodFn:function(){ this.setData({ isFold: !this.isFold }); }
                                                                  Run code
                                                                  Cut to clipboard

                                                                    显示被隐藏的元素,并隐藏已显示的元素
                                                                    $("button").click(function(){ $("p").toggle(); });
                                                                    Run code
                                                                    Cut to clipboard
                                                                      文章:微信小程序自定义选项卡tabBar模板底部顶部导航  发表时间:2018-01-04, 16:36:18  
                                                                      展开↯
                                                                      你好,残忍屏蔽广告

                                                                      确定要清除编辑框内容吗?

                                                                      该删除操作将不可恢复。

                                                                      删除 取消

                                                                      激活Windows

                                                                      转到"设置"以激活Windows。