#2414
展开↯#2415
作者:广西南宁市
说实话,“转基因技术”和“转基因作物”是两回事。主张贴标签没错,这事儿就好像你用了再生材料制造商品,厂家和鉴定机构都可以说这个安全可靠,但消费者依然有知情权。顺便,转基因技术和其他一切技术一样,比如我做存储系统,公司当然会宣称它对数据的保护安全有效,如果有必要我本人也可以提供大堆的实验报告证明它很靠谱,但是事实上你要我说这玩意儿绝对不会出问题?那可怎么保证,谁知道在代码的哪一段有个坑呢?当然,就像存储系统一样,我可以负责任的说“我司的产品可靠性不亚于其他市售产品”,目前的转基因农产品也可以说“安全性不亚于自然产物”。不过还是那句话,贴个标签呗,谁知道哪个产品其实有个坑呢?
文章:一位普通美国民众对转基因的疑问 发表时间:2016-07-11, 14:47:55
#2417
作者:广西南宁市
反对者和支持者都犯了个毛病,那就是以偏概全。转基因只是种手段,他不能保证所有转基因的作物都是安全的,也不能保证转基因出来的作物对所有人都安全。就像不是所有天然的植物都能作为人类的食物对不对? 实验室既然有能力做出转基因的玉米,当然也有能力做出转基因的毒蘑菇。举个极端的例子,如果有人对苹果过敏,对梨子不过敏。那么苹果梨他到底能不能吃?自然界的植物是人类经过几千上万年的尝试,才确定出适合人类食用的这些作物。哪怕如此,依然存在有些人能吃,有些人不能吃的食物。最典型的例如对花生,芒果,海鲜,牛奶这些最常见食物过敏的人依然很多。而转基因大部分没经过长时间的人体实验就直接上市,谁能确定是否对所有人都适合?我支持转基因,一棒子打死肯定不对,但是认为依然需要必要的长时间的大范围的人体实验才能保证转基因食品的安全性。
文章:一位普通美国民众对转基因的疑问 发表时间:2016-07-11, 14:42:01
#2418
作者:广西
一家五星级酒店,半夜三更陆续有人跳楼,120都忙不过来…原来是一个家伙喝醉了找不到房间,就在走廊挨个敲门,边敲边喊 : 我是继伟,开门!我是继伟,快开门!于是就有人相继跳楼…有一省委书记还算冷静,没跳楼,隔着门问 : 你是市纪委还是省纪委?继伟回答 : 什么他妈省的市的,我是钟继伟! 后来房间无声,待服务员开门进去发现,书记猝死了……
文章:我看过一个故事 发表时间:2016-07-11, 12:35:37
#2420
作者:广西南宁市
全屏幻灯片滚动代码
<style>
*{padding:0px;margin:0px;}img{width:100%;/*max-height:100%;*/}
html,body{width:100%;height:100%;overflow:hidden;}
.mainbox{
overflow:hidden;
position:relative;
}
.flashbox{
overflow:hidden;
position:relative;
}
.imagebox{
text-align:right;position:relative;z-index:999;
}
.bitdiv{display:inline-block;width:18px;height:18px;margin:0 10px 10px 0px;cursor:pointer;float:right;}
.defimg{background-image:url(http://out.img.pan.lizhenqiu.com/918780a2e2d6086eb8663f66013e7a03)}
.curimg{background-image:url(http://out.img.pan.lizhenqiu.com/9a57e9567cfeb1ab47bd94b300435e8e)}</style>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.9.0/jquery.min.js"></script>
<script>
function PPTBox()
{
this.uid = PPTBoxHelper.getId();
PPTBoxHelper.instance[this.uid] = this;
this._$ = function(id){return document.getElementById(id);};
this.width = 400;//宽度
this.height = 300;//高度
this.picWidth = 15;//小图宽度
this.picHeight = 12;//小图高度
this.autoplayer = 4;//自动播放间隔(秒)
this.target = "_blank";
this._box = [];
this._curIndex = 0;
}
PPTBox.prototype =
{
_createMainBox : function (){
var flashBoxWidth = this.width * this._box.length + 5;
var html="<div id='"+this.uid+"_mainbox' class='mainbox' style='width:"+(this.width)+"px;height:"+(this.height+2)+"px;'>";
html += "<div id='"+this.uid+"_flashbox' class='flashbox' style='width:"+flashBoxWidth+"px;height:"+(this.height+2)+"px;'></div>";
html += "<div id='"+this.uid+"_imagebox' class='imagebox' style='width:"+this.width+"px;height:"+(this.picHeight+2)+"px;top:-"+(this.picHeight+20)+"px;'></div>";
html += "</div>";
document.write(html);
},
_init : function (){
var picstyle= "";
var eventstr = "PPTBoxHelper.instance['"+this.uid+"']";
var imageHTML="";
var flashbox = "";
for(var i=0;i<this._box.length;i++){
var parame = this._box[i];
flashbox += this.flashHTML(parame.url,this.width,this.height,i);
imageHTML ="<div class='bitdiv "+((i==0)?"curimg":"defimg")+"' title ="+parame.title+" src='bit01.gif' "+picstyle+" onclick = \""+eventstr+".clickPic("+i+")\" onmouseover=\""+eventstr+".mouseoverPic("+i+")\"></div>" + imageHTML;
}
this._$(this.uid+"_flashbox").innerHTML = flashbox;
this._$(this.uid+"_imagebox").innerHTML = imageHTML;
},
_play : function(){
clearInterval(this._autoplay);
var idx = this._curIndex+1;
if(idx>=this._box.length){idx=0;}
this.changeIndex(idx);
var eventstr = "PPTBoxHelper.instance['"+this.uid+"']._play()";
this._autoplay = setInterval(eventstr,this.autoplayer*1000);
},
flashHTML : function(url,width,height,idx) {
var isFlash = url.substring(url.lastIndexOf('.')+1).toLowerCase()=="swf";
var html = "";
if(isFlash){
html = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' "
+ "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='"+width+"' height='"+height+"'>"
+ "<param name=\"movie\" value=\""+url+"\" />"
+ "<param name='quality' value='high' />"
+ "<param name='wmode' value='transparent'>"
+ "<embed src='"+url+"' quality='high' wmode='opaque' pluginspage='http://www.macromedia.com/go/getflashplayer'"
+" type='application/x-shockwave-flash' width="+width+" height='"+height+"'></embed>"
+" </object>";
} else {
var eventstr = "PPTBoxHelper.instance['"+this.uid+"']";
var style = "";
if(this._box[idx].href){
style = "cursor:pointer"
}
html="<img src='"+url+"' style='width:"+width+"px;height:"+height+"px;"+style+"' onclick = \""+eventstr+".clickPic("+idx+")\"/>";
}
return html;
},
changeIndex : function(idx){
var parame = this._box[idx];
moveElement(this.uid+"_flashbox",-(idx*this.width),1);
var imgs = this._$(this.uid+"_imagebox").getElementsByTagName("div");
imgs[this._box.length-1-this._curIndex].className = "bitdiv defimg";
imgs[this._box.length-1-idx].className = "bitdiv curimg";
this._curIndex = idx;
},
mouseoverPic:function(idx){
this.changeIndex(idx);
if(this.autoplayer>0){
clearInterval(this._autoplay);
var eventstr = "PPTBoxHelper.instance['"+this.uid+"']._play()";
this._autoplay = setInterval(eventstr,this.autoplayer*1000);
}
},
clickPic:function(idx){
var parame = this._box[idx];
if(parame.href&¶me.href!=""){
window.open(parame.href,this.target);
}
},
add:function (imgParam){
this._box[this._box.length] = imgParam;
},
show : function () {
this._createMainBox();
this._init();
if(this.autoplayer>0){
var eventstr = "PPTBoxHelper.instance['"+this.uid+"']._play()";
this._autoplay = setInterval(eventstr,this.autoplayer*1000);
}
}
}
var PPTBoxHelper =
{
count: 0,
instance: {},
getId: function() { return '_ppt_box-' + (this.count++); }
};
function moveElement(elementID,final_x,interval) {
if (!document.getElementById) return false;
if (!document.getElementById(elementID)) return false;
var elem = document.getElementById(elementID);
if (elem.movement) {
clearTimeout(elem.movement);
}
if (!elem.style.left) {
elem.style.left = "0px";
}
var xpos = parseInt(elem.style.left);
if (xpos == final_x ) {
return true;
}
if (xpos < final_x) {
var dist = Math.ceil((final_x - xpos)/5);
xpos = xpos + dist;
}
if (xpos > final_x) {
var dist = Math.ceil((xpos - final_x)/5);
xpos = xpos - dist;
}
elem.style.left = xpos + "px";
var repeat = "moveElement('"+elementID+"',"+final_x+","+interval+")";
elem.movement = setTimeout(repeat,interval);
}
</script>
<div id="xxx" >
<script>
var box =new PPTBox();
box.width = $(window).width(); //600; //宽度
box.height = $(window).height(); //295;//高度
box.autoplayer = 3;//自动播放间隔时间
//box.add({"url":"图片地址","title":"悬浮标题","href":"链接地址"})
box.add({"url":"http://li.img.pan.lizhenqiu.com/f07ac1c21c09a4b8d99446b1137560a7.jpg","href":"http://www.lizhenqiu.com/","title":"iswtf"})
box.add({"url":"http://li.img.pan.lizhenqiu.com/f07ac1c21c09a4b8d99446b1137560a7.jpg","href":"http://www.lizhenqiu.com/","title":"iswtf"})
box.add({"url":"http://li.img.pan.lizhenqiu.com/f07ac1c21c09a4b8d99446b1137560a7.jpg","href":"http://www.lizhenqiu.com/","title":"iswtf"})
box.add({"url":"http://li.img.pan.lizhenqiu.com/f07ac1c21c09a4b8d99446b1137560a7.jpg","href":"http://www.lizhenqiu.com/","title":"iswtf"})
box.show();
</script>
</div>
Run code
Cut to clipboard
文章:纯原生JS幻灯片-实现多屏切换效果代码 发表时间:2016-07-07, 12:06:09
#2421
作者:广西南宁市
$('#test').removeAttr("style")
window.onscroll = function(){
var t = document.documentElement.scrollTop || document.body.scrollTop;
var top_div = document.getElementById( "top_div" );
if( t >= 300 ) {
top_div.style.display = "inline";
} else {
top_div.style.display = "none";
}
} Run code
Cut to clipboard
文章:常用html、demo代码 发表时间:2016-07-06, 14:46:33
#2422
作者:广西南宁市
江湖:从前有一个人出来混,一直被对手打压欺负,然后他苦练功夫,终于报仇雪耻,他叫乔丹;从前有一个人出来混,一直被对手打压欺负,然后他叫了一帮兄弟,也终于出头,他叫詹姆斯;现在有一个人出来混,被对手打压欺负,然后他说“让我加入你们吧,我也想欺负人”,他是杜兰特。
文章:我身边有个这样的人 发表时间:2016-07-05, 14:23:55
#2423
作者:广西南宁市
一项产品的成功说到底还是取决于用户,在此基础上的团队合作与执行才是巩固产品的驱动力,FB成功至今是因为抓住了用户的心。
文章:Facebook设计总监:我的产品设计年度总结 发表时间:2016-07-05, 10:50:40
#2424
展开↯#2425
作者:广西南宁市
I sit at my window this morning where the world like a passer-by stops for a moment, nods to me and goes.
我今晨坐在窗前,世界如一个路人似的,停留了一会,向我点点头又走过去了。
--泰戈尔《飞鸟集》
我今晨坐在窗前,世界如一个路人似的,停留了一会,向我点点头又走过去了。
--泰戈尔《飞鸟集》
文章:成功的故事只能倒叙着讲 发表时间:2016-07-04, 16:49:04
#2426
作者:广西南宁市
Web前端
Javascript
添加cookie
获取指定名称的cookie的值
删除指定名称的cookie,可以将其过期时间设定为一个过去的时间
是否存在某个class
对节点增加class
对节点删除class
数组复制技巧
方法一
方法二
打乱数字数组的顺序
给数组创建一个随机项
数组追加
获得数组中的最大值
写法一
写法二
类数组转换成数组
写法一
写法二
字符串去重
字符串反序列化成JSON
eval方式解析
new Function形式
使用全局的JSON对象
获取某月天数
日期对象转换成时间戳
跨浏览器DOM对象:DOMUtil
获取指定class名称的DOM对象
获取选中文本内容
跨浏览器获取可视窗口大小
通用事件兼容框架:EventUtil
取消浏览器默认行为
阻止事件冒泡
模拟触发点击事件
参数 描述
eventType 想获取的 Event 对象的事件模块名。
返回值
返回新创建的 Event 对象,具有指定的类型。
抛出
如果实现支持需要的事件类型,该方法将抛出代码为 NOT_SUPPORTED_ERR 的 DOMException 异常。
说明
该方法将创建一种新的事件类型,该类型由参数 eventType 指定。注意,该参数的值不是要创建的事件接口的名称,而是定义那个接口的 DOM 模块的名称。
下表列出了 eventType 的合法值和每个值创建的事件接口: eventType 的合法值和每个值创建的事件接口:
用该方法创建了 Event 对象以后,必须用上表中所示的初始化方法初始化对象。
对象深度克隆
简单的克隆:
方法一
方法二(系列化对象)
数组深度克隆
函数深度克隆
电子邮箱
固定电话
手机号码
ip地址
域名
HTML5标签兼容
横屏监听
根据AMD规范写插件
Javascript
添加cookie
function addCookie(objName,objValue,objHours,objDomain,objPath){
var str = objName + "=" + escape(objValue);
if(objHours > 0){ //为时不设定过期时间,浏览器关闭时cookie自动消失
var date = new Date();
var ms = objHours*3600*1000;
date.setTime(date.getTime() + ms);
str += "; expires=" + date.toGMTString();
if(objDomain){
str += ";domain="+objDomain;
}
if(objPath){
str += ";path="+objPath;
}
}
document.cookie = str;
}Run code
Cut to clipboard
获取指定名称的cookie的值
function getCookie(objName){
var arrStr = document.cookie.split("; ");
for(var i = 0;i < arrStr.length;i ++){
var temp = arrStr[i].split("=");
if(temp[0] == objName) return unescape(temp[1]);
}
}Run code
Cut to clipboard
删除指定名称的cookie,可以将其过期时间设定为一个过去的时间
function delCookie(name){
var date = new Date();
date.setTime(date.getTime() - 10000);
document.cookie = name + "=a; expires=" + date.toGMTString();
}Run code
Cut to clipboard
是否存在某个class
function hasClass(node,classname){
return node.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}Run code
Cut to clipboard
对节点增加class
function addClass(node,classname){
if(!this.hasClass(node,classname)){
node.className = (node.className+" "+classname).replace(/^\s+|\s+$/g,'');
}
}Run code
Cut to clipboard
对节点删除class
function removeClass(node,classname){
node.className = (node.className.replace(classname,"")).replace(/^\s+|\s+$/g,'');
}Run code
Cut to clipboard
数组复制技巧
方法一
var a = [1,2,3];
b = a.slice(0);Run code
Cut to clipboard
方法二
var a = [1,2,3];
b = a.concat();Run code
Cut to clipboard
打乱数字数组的顺序
numbers.sort(function(){ return Math.random() - 0.5});Run code
Cut to clipboard
给数组创建一个随机项
var items = [12, 548 , 'a' , 2 , 5478 , 'foo' , 8852, , 'Doe' , 2145 , 119];
var randomItem = items[Math.floor(Math.random() * items.length)];Run code
Cut to clipboard
数组追加
Array.prototype.push.apply(array1, array2);Run code
Cut to clipboard
获得数组中的最大值
写法一
var a = [10,1,2,3,4,8,9];
Math.max.apply(null,a);Run code
Cut to clipboard
写法二
Array.prototype.max = function() {
return Math.max.apply({},this);
}Run code
Cut to clipboard
类数组转换成数组
写法一
var args = Array.prototype.slice.call(arguments, 0);Run code
Cut to clipboard
写法二
var args = [].slice.call(arguments);Run code
Cut to clipboard
字符串去重
"aagbdfcedskahkxxbhxbshb".replace(/(\w)(?=\w*\1)/gi,"");Run code
Cut to clipboard
字符串反序列化成JSON
eval方式解析
function strToJson(str){
var json = eval_r('(' + str + ')'); //或eval('('+Json+')')
return json;
}Run code
Cut to clipboard
new Function形式
function strToJson(str){
var json = (new Function("return " + str))();
return json;
}Run code
Cut to clipboard
使用全局的JSON对象
function strToJson(str){
return JSON.parse(str);
}Run code
Cut to clipboard
获取某月天数
var day = new Date(2014,4,0); //获取4月份的天数
var count = day.getDate();Run code
Cut to clipboard
日期对象转换成时间戳
var d = +new Date(); //1466489912445Run code
Cut to clipboard
跨浏览器DOM对象:DOMUtil
获取指定class名称的DOM对象
function getElementsByClassNamefunction(className,context,tagName){
if(typeof context == 'string'){
tagName = context;
context = document;
}else{
context = context || document;
tagName = tagName || '*';
}
if(context.getElementsByClassName){
return context.getElementsByClassName(className);
}
var nodes = context.getElementsByTagName(tagName);
var results= [];
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
var classNames = node.className.split(' ');
for (var j = 0; j < classNames.length; j++) {
if (classNames[j] == className) {
results.push(node);
break;
}
}
}
return results;
}Run code
Cut to clipboard
获取选中文本内容
function getSelectedText() {
if (window.getSelection) {
return window.getSelection().toString();
}else if (document.getSelection) {
return document.getSelection();
}else if (document.selection) {
return document.selection.createRange().text;
}
}Run code
Cut to clipboard
跨浏览器获取可视窗口大小
function getWindow () {
if(typeof window.innerWidth !='undefined') {
return{
width : window.innerWidth,
height : window.innerHeight
}
}else{
return {
width : document.documentElement.clientWidth,
height : document.documentElement.clientHeight
}
}
}Run code
Cut to clipboard
通用事件兼容框架:EventUtil
取消浏览器默认行为
function stopDefault( e ) {
if ( e && e.preventDefault ){
e.preventDefault();
}else{
window.event.returnValue = false;
}
return false;
}Run code
Cut to clipboard
阻止事件冒泡
function stopBubble(e){
if (e && e.stopPropagation) {
e.stopPropagation();
}else if (window.event) {
window.event.cancelBubble = true;
}
}Run code
Cut to clipboard
模拟触发点击事件
function simulateClick(el) {
var evt;
if (document.createEvent) { // DOM Level 2 standard
evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
el.dispatchEvent(evt);
} else if (el.fireEvent) { // IE
el.fireEvent('onclick');
}
}
createEvent(eventType)Run code
Cut to clipboard
参数 描述
eventType 想获取的 Event 对象的事件模块名。
返回值
返回新创建的 Event 对象,具有指定的类型。
抛出
如果实现支持需要的事件类型,该方法将抛出代码为 NOT_SUPPORTED_ERR 的 DOMException 异常。
说明
该方法将创建一种新的事件类型,该类型由参数 eventType 指定。注意,该参数的值不是要创建的事件接口的名称,而是定义那个接口的 DOM 模块的名称。
下表列出了 eventType 的合法值和每个值创建的事件接口: eventType 的合法值和每个值创建的事件接口:
参数 事件接口 初始化方法
HTMLEvents HTMLEvent iniEvent()
MouseEvents MouseEvent iniMouseEvent()
UIEvents UIEvent iniUIEvent()Run code
Cut to clipboard
用该方法创建了 Event 对象以后,必须用上表中所示的初始化方法初始化对象。
对象深度克隆
Object.prototype.clone = function () {
var newObj = {};
for (var i in this) {
console.log("i = " + i)
if (typeof(this[i]) == 'object'|| typeof(this[i]) == 'function') {
newObj[i] = this[i].clone()
} else {
newObj[i] = this[i]
}
}
return newObj
}Run code
Cut to clipboard
简单的克隆:
方法一
obj = eval(uneval(o));Run code
Cut to clipboard
方法二(系列化对象)
obj= JSON.parse(JSON.stringify(o));Run code
Cut to clipboard
数组深度克隆
Array.prototype.clone = function () {
var newArray = []
for (var i = 0; i < this.length; i++) {
if (typeof(this[i]) == 'object' || typeof(this[i]) == 'function') {
newArray[i] = this[i].clone()
} else {
newArray[i] = this[i]
}
}
return newArray
}Run code
Cut to clipboard
函数深度克隆
Function.prototype.clone = function () {
var that = this;
var newFunc = function () {
return that.apply(this, arguments);
};
for (var o in this) {
newFunc[o] = this[o];
}
return newFunc;
}Run code
Cut to clipboard
电子邮箱
/^[0-9a-z][0-9a-z\-\_\.]+@([0-9a-z][0-9a-z\-]*\.)+[a-z]{2,}$/iRun code
Cut to clipboard
固定电话
/^0[0-9]{2,3}[2-9][0-9]{6,7}$/Run code
Cut to clipboard
手机号码
/^(\+?0{0,2}86([\ |\-])?)?1[3|4|5|7|8][0-9]{9}$/Run code
Cut to clipboard
ip地址
/^((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]\d)|\d)(\.((25[0-5])|(2[0-4]\d)|(1\d\d)|([1-9]\d)|\d)){3}$/Run code
Cut to clipboard
域名
/^([a-zA-Z0-9][-a-zA-Z0-9]{0,62}\.)+([a-zA-Z]{0,63})\.?$/Run code
Cut to clipboard
HTML5标签兼容
(function(){
var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure, footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),
i= e.length;
while(i--){
document.createElement(e[i]);
}
})();Run code
Cut to clipboard
横屏监听
var updateOrientation =function(){
if(window.orientation=='-90'|| window.orientation=='90'){
console.log('为了更好的体验,请将手机/平板竖过来!');
}else{
console.log('竖屏状态');
}
};
var supportsOrientationChange = "onorientationchange" in window,
orientationEvent = supportsOrientationChange ? "orientationchange" : "resize";// 监听事件
window.addEventListener(orientationEvent,updateOrientation);Run code
Cut to clipboard
根据AMD规范写插件
;(function () {
'use strict';
function pluginName(layer, options) {
var something;
options = options || {};
this.layer = layer;
this.param1 = options.param1||'';
}
var privateField = '';
pluginName.prototype.fun1 = function(){
}
/**
* Factory method for creating a object
*/
pluginName.attach = function(layer, options) {
return new pluginName(layer, options);
};
if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// AMD. Register as an anonymous module.
define(function() {
return pluginName;
});
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = pluginName.attach;
module.exports.pluginName = pluginName;
} else {
window.pluginName = pluginName;
}
}());Run code
Cut to clipboard
http://passer-by.com/front-end-note/Run code
Cut to clipboard
文章:全站变灰,悼念代码 发表时间:2016-07-04, 16:46:31
#2427
作者:广西南宁市
CSS
reset.css
clearfix
placeholder
文本省略号
重置默认行为
重置按键样式
横竖屏判断
全站变灰
reset.css
clearfix
placeholder
文本省略号
重置默认行为
重置按键样式
横竖屏判断
全站变灰
文章:全站变灰,悼念代码 发表时间:2016-07-04, 16:38:43
#2428
作者:广西南宁市
设备竖屏时调用该段css代码:
设备横屏时调用该段css代码:
@media all and (orientation : portrait){
}Run code
Cut to clipboard
设备横屏时调用该段css代码:
@media all and (orientation : landscape){
}Run code
Cut to clipboard
文章:全站变灰,悼念代码 发表时间:2016-07-04, 16:38:07
#2429
作者:广西南宁市
去除表单自动填充颜色(Chrome浏览器)
去除按键圆角(iPhone)
去除搜索按键(Chrome浏览器)
去除数字输入框增减按键(Chrome浏览器)
去除date类型文本框多了个叉叉清除内容的效果(Chrome浏览器)
去除按键虚线框(Firefox浏览器)
改变password类型input框的默认样式(IE浏览器)
设置默认线框距离
input字体垂直居中
input:-webkit-autofill {
background-color: #FAFFBD;
background-image: none;
color: #000;
}Run code
Cut to clipboard
去除按键圆角(iPhone)
-webkit-appearance:none;Run code
Cut to clipboard
去除搜索按键(Chrome浏览器)
input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{
-webkit-appearance: none;
}Run code
Cut to clipboard
去除数字输入框增减按键(Chrome浏览器)
input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{
-webkit-appearance: none;
}Run code
Cut to clipboard
去除date类型文本框多了个叉叉清除内容的效果(Chrome浏览器)
::-webkit-clear-button {
-webkit-appearance: none;
}Run code
Cut to clipboard
去除按键虚线框(Firefox浏览器)
button::-moz-focus-inner,input::-moz-focus-inner{
}Run code
Cut to clipboard
改变password类型input框的默认样式(IE浏览器)
::-ms-reveal{display: none; }
::-ms-reveal{background-color:#f0f3f9; }Run code
Cut to clipboard
设置默认线框距离
input {outline-offset: 4px ;}Run code
Cut to clipboard
input字体垂直居中
font-family: Tahoma,Arial, Helvetica,"Microsoft YaHei";Run code
Cut to clipboard
文章:全站变灰,悼念代码 发表时间:2016-07-04, 16:37:18
#2430
作者:广西南宁市
禁用鼠标
禁止文本选中
自定义文本选择
禁用输入法
隐藏IE10默认在input框输入内容后显示“X”按钮
pointer-events: none;Run code
Cut to clipboard
禁止文本选中
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
user-select: none;Run code
Cut to clipboard
自定义文本选择
::selection { background: #e2eae2; }
::-moz-selection { background: #e2eae2; }
::-webkit-selection { background: #e2eae2; }Run code
Cut to clipboard
禁用输入法
ime-mode:disabled;Run code
Cut to clipboard
隐藏IE10默认在input框输入内容后显示“X”按钮
pointer-events: none;Run code
Cut to clipboard
文章:全站变灰,悼念代码 发表时间:2016-07-04, 16:36:08
#2431
作者:广西南宁市
文本超出省略号
多行文本超出省略号
display:block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;Run code
Cut to clipboard
多行文本超出省略号
display: -webkit-box;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
overflow: hidden;
-webkit-line-clamp: 2;Run code
Cut to clipboard
文章:全站变灰,悼念代码 发表时间:2016-07-04, 16:35:02
#2432
作者:广西南宁市
Chrome浏览器(webkit)
注:webkit下在文本框获取焦点后不显示placeholder,以便使其与其他浏览器表现一致
Firefox浏览器
IE浏览器
::-webkit-input-placeholder {
color: #999;
}Run code
Cut to clipboard
注:webkit下在文本框获取焦点后不显示placeholder,以便使其与其他浏览器表现一致
:focus::-webkit-input-placeholder {
color: transparent !important;
}Run code
Cut to clipboard
Firefox浏览器
/* Mozilla Firefox 4 to 18 */
:-moz-placeholder {
color: #999;
}
/* Mozilla Firefox 19+ */
::-moz-placeholder {
color: #999;
}Run code
Cut to clipboard
IE浏览器
/* Internet Explorer 10+ */
:-ms-input-placeholder {
color: #999;
}Run code
Cut to clipboard
文章:全站变灰,悼念代码 发表时间:2016-07-04, 16:34:18
问题的关键其实是双方争论的根本不是同一个问题,反转人士担心的是其危害,特别是“基因级别的危害”;而挺转人士担心的是转基因被妖魔化。两方其实都有道理,但大多数围观群众并不会仔细去想里面道理——如果反转人士大获全胜,结果肯定是转基因成为过街老鼠人人喊打,结果就是这么个有着极大应用价值乃至通过促进基因科学而改变整个人类历史走向的技术被人类自己主动放弃了,甚至会因此掀起一轮反技术浪潮;但如果挺转人士大获全胜,结果就是转基因成为“纳米”这样的时髦事物,那就不可避免地出现商业化的技术滥用而导致大量问题。不过现在看来后一个后果还要好一点,毕竟转移因技术滥用的后果是暂时的,不会对人类社会及环境造成不可逆转的损害(从某种意义上说这一点才是双方应该争论的焦点),但前一种则可能造成人类思想的大步倒退。
所以,转基因是不是会有危害、安全不安全这个问题没有意义,因为答案很简单——有可能有潜在的危害,就跟当初人类学会使用的火一样,安不安全取决于人怎么用。