<script>
var imgArr=['/images/b1.jpg', '/images/b2.jpg', '/images/b0.jpg'];
var indexImage=parseInt(Math.random()*(imgArr.length-0));
var currentImage=imgArr[indexImage];
document.getElementsByTagName('body')[0].style.cssText = "background: url("+currentImage+");background-repeat: no-repeat;background-position: left top;";
</script>
#571
#572
<include file="Addons/WeiSite/View/default/TemplateIndex/weiante/weiante_head.html"/> <script src="/js/jquery.cookie.js"></script> <script> //set cookie setcookiell(); function setcookiell(){ //读取cookie var mtel=$.cookie('mtel'); var loginsalat=$.cookie('loginsalat'); var id=$.cookie('id'); //设置localStorage if(mtel && loginsalat && id){ localStorage.setItem("mtel",mtel); localStorage.setItem("loginsalat",loginsalat); localStorage.setItem("id",id); return false; } var ltel=localStorage.mtel; var llogg=localStorage.loginsalat; var lid=localStorage.id; if(ltel && llogg && lid){ $.cookie('mtel', ltel, { expires: 70 }); $.cookie('loginsalat', llogg, { expires: 70 }); $.cookie('id', lid, { expires: 70 }); location.href = '<?php echo $_SESSION['dangqian_url'];?>'; } } </script> <div class="banner1"> <!---------------------------------- container开始 ----------------------------------> <!--幻灯片--> <script type="text/javascript" src="/js/prefixfree.min.js"></script> <script type="text/javascript" src="/js/flipsnap.min.js"></script> <script> var ww=$(window).width(); //banner var w=430; var h=200; var b=1; var newsssheigtg=(ww*b*h)/w; new_widht_baifenbi_kuandu=1; var xiaoxunews=ww-(182/360)*ww; document.write("<style>.index-h-l-wenzi{width:"+xiaoxunews+"px;top: 50%;margin-top: -28px;}</style>"); </script> <script type="text/javascript" src="/js/mobile_module.js"></script> <script type="text/javascript" src="/js/admin_common.js"></script> <div class="container" style="padding-top: 55px; width:100%;"> <section class="banner" style="height:200px;"> <ul style="width: 1200px; height: 200px; transition-property: transform; transition-timing-function: cubic-bezier(0, 0, 0.25, 1); transition-duration: 350ms; transform: translate3d(-800px, 0px, 0px);"> <li style="width:100%; height: 200px;"><a href="#"><img src="{$url.img|get_cover_url}" style="width:100%;height:auto"></a></li> </ul> <!--<span class="identify"> <em class="cur"></em> <em ></em> <em ></em> </span> --></section> </div> <script type="text/javascript"> $(function(){ $.WeiPHP.initBanner(true,5000); $.WeiPHP.setRandomColor('.random_color'); }) </script> <!--幻灯片--> <!---------------------------------- container结束 ----------------------------------> </div> <!--登录 开始--> <div class="sign"> <div class="bt">登录<p>SIGN IN</p></div> <div class="nr"> <form id="login" action="/index.php?s=/addon/WeiSite/WeiSite/member.html" method="post" id="cart"> <p class="clearfix"><input class="phone" name="tel" value="手机号" style="line-height:normal" type="text" onfocus="if (value =='手机号'){value =''}" onblur="if (value ==''){value='手机号'}" /></p> <p class="clearfix"><input id="showPwd2" class="xx_zupassword " type="text" value="密码" style="width: 94%; height: 42px;margin-top: 0.8rem;font-family: '微软雅黑';text-indent: 12px;color: #ada8a0; font-size: 12px;" /></p> <p class="clearfix"><input class="mm" value="" id="pwd2" style="line-height:normal;display:none;" name="pass" type="password" maxlength="16" /></p> <script> var showPwd2 = $("#showPwd2"), pwd2 = $("#pwd2"); showPwd2.focus(function(){ pwd2.show().focus();//获取焦点事件时pwd2显示 showPwd2.hide();//showPwd2隐藏 }); pwd2.blur(function(){ if(pwd2.val()=="") { showPwd2.show(); pwd2.hide(); } }); </script> <p class="clearfix"><input class="yzm" value="验证码" style="line-height:normal" name="yzm" type="text" onfocus="if (value =='验证码'){value =''}" onblur="if (value ==''){value='验证码'}" maxlength="5"/> <img style="width:100px;height:41px;float:left; margin-top:0.8rem;" id="codeyzmm" src="/index.php?s=/addon/Dsend/Dsend/yanzhengma.html" onclick="this.src=this.src+'#'+Math.random();"></p> <!-- <input type="submit" value="获取验证码" class="hqyzm" /> console.log(this.src); --> <p class="clearfix" id="inpuddso"><input type="submit" value="登录" class="dl" /></p> <p class="dl" id="inpuddst" style="display:none;line-height: 42px;">正在登录...</p> <p class="zczh"><a href="/index.php?s=/addon/WeiSite/WeiSite/register.html">注册账号</a><span><a href="/index.php?s=/addon/WeiSite/WeiSite/password.html">忘记密码?</a></span></p> </form> </div> </div> <!--登录 结束--> <!--表单判断--> <script> var newurl='<?php echo $_SESSION['newurl']; ?>'; $("#login").submit(function(e){ //判断用户名是否注册 var phone=$('.phone').val();//用户名 var yzm=$('.yzm').val(); var mm=$('.mm').val();//确认密码 if(!phone || phone=='手机号'){ alert('请输入您的手机号'); return false; } if(!mm || mm=='密码'){ alert('请输入您的密码'); return false; } if(!yzm || yzm=='验证码'){ alert('请输入验证码'); return false; } //异步提交登录 $.ajax( { url: '/index.php?s=/addon/Dsend/Dsend/login.html', //这里是静态页的地址 data:$('#login').serialize(), type: "POST", //静态页用get方法,否则服务器会抛出405错误 //dataType: "json", //cache: false, //async: false, beforeSend: function(){ // Handle the beforeSend event $('#inpuddso').hide(); $('#inpuddst').show(); }, success: function(data){ //alert(data); switch(data){ case 'e1': alert('数据提交异常'); $('#inpuddso').show(); $('#inpuddst').hide(); break; case 'e2': alert('手机号没有注册'); $('#inpuddso').show();$('#inpuddst').hide(); break; case 'e3': alert('验证码错误'); $('#codeyzmm').attr('src',$('#codeyzmm').attr('src')+'#'+Math.random()); $('#inpuddso').show();$('#inpuddst').hide(); break; case 'e4': alert('密码错误'); $('#inpuddso').show();$('#inpuddst').hide(); break; default: //alert($.parseJSON(data).loginsalat); //alert('登陆成功'); $('#inpuddso').hide();$('#inpuddst').show(); setcookiell(); if(newurl){ location=newurl; }else{ location='/index.php?s=/addon/WeiSite/WeiSite/member.html'; } } //var result = $(data).find("另一个html页面的指定的一部分").html(); } }); return false; }); </script> <!--end--> <script type="text/javascript"> /*function Code(){ var img = document.getElementById("code"); img.src = "{:U('/addon/WeiSite/code')}?code=" + Math.random(); } */ </script> <div class="clearfix"></div> <include file="Addons/WeiSite/View/default/TemplateIndex/weiante/weiante_footer.html"/>
//判断登录状态 function mChacklogin(){ $_SESSION['dangqian_url']=__SELF__; $mtel=$_COOKIE['mtel']; $loginsalat=$_COOKIE['loginsalat']; $id=$_COOKIE['id']+0; if($mtel && $id && $loginsalat){
#573
// 获取当前用户ID define('UID',is_login()); if( !UID ){// 还没登录 跳转到登录页面 $this->redirect('Public/login'); }
$s=M('custom_reply_news')->where('id in ('.$id.')')->order('field(id,'.$id.')')->select(); //按in里面的顺序来排序
非管理员不能查看测试中前端页面,显示正在建设中
class WeiSiteController extends BaseController { var $config; function _initialize() { parent::_initialize(); if(!(is_login())){ $this->display(ONETHINK_ADDON_PATH . 'WeiSite/View/default/TemplateIndex/' . $this->config ['template_index'] . '/cccs.html'); exit; } } function config() {
<!DOCTYPE html> <html> <head> <title>网站正在建设中... </title> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <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" /> </head> <body> 网站正在建设中... </body> </html>
$Model->field('id,title,content')->select();
class Action{ public function __construct() {
datetimepicker weiphp datetime weiphp日期时间组件 weiphp时间选择
config.php
'bbyueyuesjtfjjs' => array ( 'title' => '放假结束日期时间:', 'type' => 'datetime', 'value' => '', 'tip' => '结束日期要晚于开始日期 到期后自动失效' ),
\Application\Home\View\default\Addons\config.html
<case value="datetime"> <div class="controls"> <input type="datetime" id="{$o_key}" name="config[{$o_key}]" class="text input-large time" value="{$form.value}"> </div> </case> <case value="text"> <div class="controls"> <input type="text" name="config[{$o_key}]" class="text input-large" value="{$form.value}"> </div> </case>
<block name="script"> <link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css"> <php>if(C('COLOR_STYLE')=='blue_color') echo ' <link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css"> ';</php> <link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css"> <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.js"></script> <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js?v={:SITE_VERSION}" charset="UTF-8"></script> <script type="text/javascript" charset="utf-8">$(function(){ $('.time').datetimepicker({ format: 'yyyy-mm-dd hh:ii', language:"zh-CN", minView:0, autoclose:true }); $('.date').datetimepicker({ format: 'yyyy-mm-dd', language:"zh-CN", minView:2, autoclose:true }); //showTab(); $('.toggle-data').each(function(){ var data = $(this).attr('toggle-data'); if(data=='') return true; if($(this).is(":selected") || $(this).is(":checked")){ change_event(this) } }); $('.toggle-data').bind("click",function(){ change_event(this) }); }); /*$(function(){ //初始化上传图片插件 initUploadImg(); initUploadFile(); //支持tab showTab(); })*/ </script> </block>
class WeiSiteController extends BaseController { function _initialize() { parent::_initialize (); $bbyueyuesjtfjks=strtotime($this->config ['bbyueyuesjtfjks']); $ntime=time(); $bbyueyuesjtfjjs=strtotime($this->config ['bbyueyuesjtfjjs']); if(!(is_login()) && $ntime>$bbyueyuesjtfjks && $ntime<$bbyueyuesjtfjjs){ $this->ee(); exit; } } function config() {
#574
js 修改body js csstext js随机背景
<script> var imgArr=['/images/b1.jpg', '/images/b2.jpg', '/images/b0.jpg']; var indexImage=parseInt(Math.random()*(imgArr.length-0)); var currentImage=imgArr[indexImage]; document.getElementsByTagName('body')[0].style.cssText = "background: url("+currentImage+");background-repeat: no-repeat;background-position: left top;"; </script>
#575
#576
#577
//多余显示省略号 function wordlimit(cname, wordlength) { var cname = document.getElementsByClassName(cname); for (var i = 0; i < cname.length; i++) { var nowLength = cname[i].innerHTML.length; if (nowLength > wordlength) { cname[i].innerHTML = cname[i].innerHTML.substr(0, wordlength) + '...'; } } };
//调用,description为class名 wordlimit('description', 30)
示例:
<div class="description">伊思网拓伊网博客互联网解决方案提供商iswtf.com伊思网拓伊网博客互联网解决方案提供商iswtf.com伊思网拓伊网博客互联网解决方案提供商iswtf.com伊思网拓伊网博客互联网解决方案提供商iswtf.com伊思网拓伊网博客互联网解决方案提供商iswtf.com伊思网拓伊网博客互联网解决方案提供商iswtf.com伊思网拓伊网博客互联网解决方案提供商iswtf.com伊思网拓伊网博客互联网解决方案提供商iswtf.com伊思网拓伊网博客互联网解决方案提供商iswtf.com</div> <script> function wordlimit(cname, wordlength) { var cname = document.getElementsByClassName(cname); for (var i = 0; i < cname.length; i++) { var nowLength = cname[i].innerHTML.length; if (nowLength > wordlength) { cname[i].innerHTML = cname[i].innerHTML.substr(0, wordlength) + '...'; } } }; wordlimit('description', 20) </script>
#578
就给个0分吧。
#579
天朝出不了这电影,更不可能留着这几块广告牌,连发微博也要小心点被请去喝茶。
有骨气的中国人在蒙元满清都被杀光了。
这些都是蛮子的后代。
#580
#581
一位年轻人在外5年,终于要回家了。
老板问:你是要5年的工资还是3句忠告?
年轻人思考了片刻说:明早给您答复。
老板说:可以。
当晚年轻人未眠...
第二天早晨,他对老板说:我全都要
良久,张竟苏醒,群客告以解救之事。张曰:“小弟向有羊儿疯之疾,不时举发,非中河豚毒也。”于是五人深悔无故而尝粪,且嗽且呕,狂笑不止。
应该是这个,大吃货袁枚写的
#582
#583
#584
(function() {var coreSocialistValues = ["富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善"], index = Math.floor(Math.random() * coreSocialistValues.length);document.body.addEventListener('click', function(e) {if (e.target.tagName == 'A') {return;}var x = e.pageX, y = e.pageY, span = document.createElement('span');span.textContent = coreSocialistValues[index];index = (index + 1) % coreSocialistValues.length;span.style.cssText = ['z-index: 9999999; position: absolute; font-weight: bold; color: #ff6651; top: ', y - 20, 'px; left: ', x, 'px;'].join('');document.body.appendChild(span);animate(span);});function animate(el) {var i = 0, top = parseInt(el.style.top), id = setInterval(frame, 16.7);function frame() {if (i > 180) {clearInterval(id);el.parentNode.removeChild(el);} else {i+=2;el.style.top = top - i + 'px';el.style.opacity = (180 - i) / 180;}}}}());
_attachEvent(window, 'scroll', function () { showTopLink(); });checkBlind();
discuz论坛左边栏头像信息滚动自动固定js
function ctrlLeftInfo(sli_staticnum) { var sli = $('scrollleftinfo'); var postlist_bottom = parseInt($('postlist').getBoundingClientRect().bottom); var sli_bottom = parseInt(sli.getBoundingClientRect().bottom); if (postlist_bottom < sli_staticnum && postlist_bottom != sli_bottom) { sli.style.top = (postlist_bottom - sli.offsetHeight - 5) + 'px'; } else { sli.style.top = 'auto'; } } function fixed_avatar(pids, fixednv) { var fixedtopnv = fixednv ? new fixed_top_nv('nv', true) : false; if (fixednv) { fixedtopnv.init(); } function fixedavatar(e) { var avatartop = fixednv ? fixedtopnv.run() : 0; for (var i = 0; i < pids.length; i++) { var pid = pids[i]; var posttable = $('pid' + pid); var postavatar = $('favatar' + pid); if (!$('favatar' + pid)) { return; } var nextpost = $('_postposition' + pid); if (!postavatar || !nextpost || posttable.offsetHeight - 100 < postavatar.offsetHeight) { if (postavatar.style.position == 'fixed') { postavatar.style.position = ''; } continue; } var avatarstyle = postavatar.style; posttabletop = parseInt(posttable.getBoundingClientRect().top); nextposttop = parseInt(nextpost.getBoundingClientRect().top); if (nextposttop > 0 && nextposttop <= postavatar.offsetHeight) { if (BROWSER.firefox) { if (avatarstyle.position != 'fixed') { avatarstyle.position = 'fixed'; } avatarstyle.top = -(postavatar.offsetHeight - nextposttop) + 'px'; } else { postavatar.parentNode.style.position = 'relative'; avatarstyle.top = ''; avatarstyle.bottom = '0px'; avatarstyle.position = 'absolute'; } } else if (posttabletop < 0 && nextposttop > 0) { if (postavatar.parentNode.style.position != '') { postavatar.parentNode.style.position = ''; } if (avatarstyle.position != 'fixed' || parseInt(avatarstyle.top) != avatartop) { avatarstyle.bottom = ''; avatarstyle.top = avatartop + 'px'; avatarstyle.position = 'fixed'; } } else if (avatarstyle.position != '') { avatarstyle.position = ''; } } } if (!(BROWSER.ie && BROWSER.ie < 7)) { _attachEvent(window, 'load', function () { _attachEvent(window, 'scroll', fixedavatar); }); } }
手机端无效解决办法
(function() {var coreSocialistValues = ["富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善"], index = Math.floor(Math.random() * coreSocialistValues.length);document.body.addEventListener('<?php if($Applessss){ echo 'touchstart'; }else echo 'click'; ?>', function(e) {if (e.target.tagName == 'A') {return;} <?php if($Applessss){ echo 'var x=e.targetTouches[0].pageX,y=e.targetTouches[0].pageY'; }else echo 'var x = e.pageX, y = e.pageY;'; ?>; var span = document.createElement('span');span.textContent = coreSocialistValues[index];index = (index + 1) % coreSocialistValues.length;span.style.cssText = ['z-index: 9999999; position: absolute; font-weight: bold; color: #ff6651; top: ', y - 20, 'px; left: ', x, 'px;'].join('');document.body.appendChild(span);animate(span);});function animate(el) {var i = 0, top = parseInt(el.style.top), id = setInterval(frame, 16.7);function frame() {if (i > 180) {clearInterval(id);el.parentNode.removeChild(el);} else {i+=2;el.style.top = top - i + 'px';el.style.opacity = (180 - i) / 180;}}}}());
手机端拖拽事件: touchstart事件:当手指触摸屏幕时候触发,即使已经有一个手指放在屏幕上也会触发。 touchmove事件:当手指在屏幕上滑动的时候连续地触发。在这个事件发生期间,调用preventDefault()事件可以阻止滚动。 touchend事件:当手指从屏幕上离开的时候触发。 touchcancel事件:当系统停止跟踪触摸的时候触发。 调用方法: (1)jquery方法:$(document).bind("touchend", function(e){}); (2)javascript方法:document.addEventListener("touchend",function(e){}); 手机端获取pageX和pageY: touchstart事件下获取:e.originalEvent.targetTouches[0].pageX。 touchmove事件下获取:e.originalEvent.targetTouches[0].pageX。 touchend事件的下获取:e.originalEvent.changedTouches[0].pageX 。 每个Touch对象包含的属性如下。 clientX:触摸目标在视口中的x坐标。 clientY:触摸目标在视口中的y坐标。 identifier:标识触摸的唯一ID。 pageX:触摸目标在页面中的x坐标。 pageY:触摸目标在页面中的y坐标。 screenX:触摸目标在屏幕中的x坐标。 screenY:触摸目标在屏幕中的y坐标。 target:触目的DOM节点目标。
touches: 当前屏幕上所有触摸点的列表; targetTouches: 当前对象上所有触摸点的列表; changedTouches: 涉及当前(引发)事件的触摸点的列表 通过一个例子来区分一下触摸事件中的这三个属性: 1. 用一个手指接触屏幕,触发事件,此时这三个属性有相同的值。 2. 用第二个手指接触屏幕,此时,touches有两个元素,每个手指触摸点为一个值。当两个手指触摸相同元素时, targetTouches和touches的值相同,否则targetTouches 只有一个值。changedTouches此时只有一个值, 为第二个手指的触摸点,因为第二个手指是引发事件的原因 3. 用两个手指同时接触屏幕,此时changedTouches有两个值,每一个手指的触摸点都有一个值 4. 手指滑动时,三个值都会发生变化 5. 一个手指离开屏幕,touches和targetTouches中对应的元素会同时移除,而changedTouches仍然会存在元素。 6. 手指都离开屏幕之后,touches和targetTouches中将不会再有值,changedTouches还会有一个值, 此值为最后一个离开屏幕的手指的接触点。 2. 触点坐标选取 touchstart和touchmove使用: e.targetTouches[0].pageX 或 (jquery)e.originalEvent.targetTouches[0].pageX touchend使用: e.changedTouches[0].pageX 或 (jquery)e.originalEvent.changedTouches[0].pageX 3.touchmove事件对象的获取 想要在touchmove:function(e,参数一)加一个参数,结果直接使用e.preventDefault()就会 e 报错,处理方法为使用arguments[0]获取event参数 touchmove:function(e,参数一){ var e=arguments[0] e.preventDefault() }
使用cssText时应该采用叠加的方式以保留原有的样式
function setStyle(el, strCss){ var sty = el.style; sty.cssText = sty.cssText + strCss; }
使用该方法在IE9/Firefox/Safari/Chrome/Opera中没什么问题,但由于 IE6/7/8中cssText返回值少了分号 会让你失望。
因此对IE6/7/8还需单独处理下,如果cssText返回值没";"则补上
function setStyle(el, strCss){ function endsWith(str, suffix) { var l = str.length - suffix.length; return l >= 0 && str.indexOf(suffix, l) == l; } var sty = el.style, cssText = sty.cssText; if(!endsWith(cssText, ';')){ cssText += ';'; } sty.cssText = cssText + strCss; }
cssText
js pageX手机无效
js join
<script type="text/javascript"> var arr = new Array(3) arr[0] = "George" arr[1] = "John" arr[2] = "Thomas" document.write(arr.join(".")) //输出: //George.John.Thomas </script>
join() 方法用于把数组中的所有元素放入一个字符串
如果省略该参数,则使用逗号作为分隔符。
#585
次日小姐垂泪送书生:“君若高中莫负妾身。”
书生发誓后,带着姑娘给的银子走了。
小姐让丫环把书生的名字纪录在册,丫头说:“这已经是第五十个书生了!”
小姐说:“没办法,总有一个会真的考上的”。
——2017最佳小说《风投》
书生让书童把小姐的名字记下,感叹说:这是第一百个了啊。
——2017最佳小说《融资》
书生的伴读童子问书生:公子,自从三年前你离家,如今已经睡了九十余名女子了,我们在各大赴京路上往复,难道就不去赶考了吗?书生答:赶考当大官不也是为了钱和女人吗?既得痴情女子九十有余,还赶着考啥?
——2017最佳小说《泡沫》
丫环帮小姐把名字记下后,从贴身处掏出一个小本,记下了第五十个书童的名字!
一一2017最佳小说《跟投》
#586
<a href="tel:400-888-6633">拨打电话<a> <a href="sms:19956321564">发送短信<a> <a href="mailto:mail@mail.com">发送邮件<a>
IE edge浏览器强制修改了电话样式,办法解决
<meta content="telephone=no" name="format-detection">
加个meta标签就可以
去掉Egde浏览器 对电话号码的默认样式
win10 edge 关闭电话号码识别
Microsoft Edge 浏览器会把某些IP地址强制识别为电话号码
#587
@-webkit-keyframes rotation{ from {-webkit-transform: rotate(0deg);} to {-webkit-transform: rotate(360deg);} } .Rotation{ -webkit-transform: rotate(360deg); animation: rotation 3s linear infinite; -moz-animation: rotation 3s linear infinite; -webkit-animation: rotation 3s linear infinite; -o-animation: rotation 3s linear infinite; }
#588
打开 Chrome 浏览器,在输入网址的地方输入
chrome://net-internals/#dns
然后点击红色条右上角的下拉按键,点击 Clear cache 和 Flush sockets 两项即可清除
#589
.item { transform: translateZ(0); /* 或者 will-change: transform; */ }
用CSS开启硬件加速来提高网站性能