小知识点总结

这篇博客整理了前端开发中的一些实用技巧,包括免费HTTPS证书的生成、常用的命令、进度条的CSS实现、去除字符串空格和HTML标签、CSS3开关样式、textarea自动增高、多屏展示、IE8兼容性解决方案等,还有ThinkPHP打印SQL语句、图片裁剪上传、Bootstrap样式调整、正则表达式匹配、禁止页面回弹等,是前端开发者必备的知识点集合。
摘要由CSDN通过智能技术生成

免费HTTPS证书生成

https://freessl.org/

抓包工具Charles Proxy License
// 适用于Charles任意版本的注册码。
// Charles 4.2目前是最新版,可用。
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4

##阿里云存储oss,图片压缩,

<img class="brand-bigimg" :src="brandDetail.bgImg+'?x-oss-process=image/format,webp'" />

常用命令:

查看9000端口的使用情况
netstat -ant |grep 9000

结束进程:
sudo pkill -9 php-fpm
sudo pkill -9 php-cgi

重启fpm:
sudo /usr/sbin/php-fpm --daemonize

切换php版本:
/Applications/MAMP/Library/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -f /Applications/MAMP/bin/php/php5.2.17/bin/php-cgi

开启权限:
chmod -R 777 *

进度条:

<div class="bg_con">
	<input id="checked_1" type="checkbox" class="switch" />
	<label for="checked_1"></label>
</div>

backbackground: -webkit-linear-gradient(left,#7bc7fd,#0094ff);

进度条的颜色变化《线性渐变》

var conPreStyle = (conPre=='100%')?('left:100%;margin-left:-2.1rem'):('left:'+ (hasRaise+isRemainNum) +'%');
  
var jinduHtml =  '<div class="bar2" style=width:'+remainPre+'></div><div class="bar3" style='+
raisedPreW+'></div><span style='+conPreStyle+'>'+(hasRaise+isRemainNum)+'%</span>';

//进度条

$(’.bar’).html(jinduHtml)
进度条进度变化,以及显示百分比的框在最右边加个判断

去字符串所有空格

username.replace(/\s/ig,'')
//去掉回车换行符
username.replace(/[\r\n]/g,"")

去掉字符串中的html标签

_content = _content.replace(/<.*?>/ig,"");

css3做switch开关

布局:

<div class="bg_con">
	<input id="checked_1" type="checkbox" class="switch" />
	<label for="checked_1"></label>
</div>

样式::before 控制背景,:after 控制白色圆圈

.anonymity .bg_con {
	float: right;
	width: .68rem;
	margin-top: .035rem;
}
.switch {
	display: none;
}

label {
	position: relative;
	display: block;
	padding: 1px;
	border-radius: 24px;
	height: 0.35rem;
	background-color: #eee;
	cursor: pointer;
	vertical-align: top;
	-webkit-user-select: none;
}
label:before {
	content: '';
	display: block;
	border-radius: 24px;
	height: .35rem;
	background: #ccc;
	-webkit-transform: scale(1, 1);
	-webkit-transition: all 0.3s ease;
}

label:after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	margin-top: -.161rem;
	margin-left: -.23rem;
	width: .34rem;
	height: .34rem;
	border-radius: 22px;
	background-color: white;
	box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.08);
	-webkit-transform: translateX(-9px);
	-webkit-transition: all 0.3s ease;
}

.switch:checked~label:after {
	-webkit-transform: translateX(21px);
}

.switch:checked~label:before {
	background: #DE2418;
}

锚点滚动

$("a.evaluate").click(function() {    
		$("html, body").animate({      
			scrollTop: $($(this).attr("href")).offset().top + "px"    
		}, {      
			duration: 500,
			easing: "swing"    
		});    
		return false;  
	});

placeholder文字靠右对齐

::-webkit-input-placeholder { /* WebKit browsers */ direction: rtl;}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ direction: rtl;}
::-moz-placeholder { /* Mozilla Firefox 19+ but I'm not sure about working */ direction: rtl;}
:-ms-input-placeholder { /* Internet Explorer 10+ */ direction: rtl;}

清除网页缓存

<meta content="no-cache" http-equiv="pragma">
<meta content="no-cache, must-revalidate" http-equiv="Cache-Control">
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

老虎帅呆了

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值