文章归档

单行文本溢出显示省略号(…)

单行文本溢出显示省略号(…) text-overflow:ellipsis—–部分浏览器还需要加宽度width属性 CSS单行、多行文本溢出显示省略号(……) END 多行文本溢出显示省略号

学习Javascript闭包(Closure)

下面就是我的学习笔记,对于Javascript初学者应该是很有用的。 一、变量的作用域 要理解闭包,首先必须理解Javascript特殊的变量作用域。 变量的作用域无非就是两种:全局变量和局部变量。

常用CSS公用部分

网页的元素默认带有一些CSS样式,而且各个浏览器的标准不同,如果不加以控制可能会影响到各个浏览器的显示。想像一下,本来各个浏览器有各自不同的标准,而且兼容性已经很耽误时间了,这样看来,对元素设置统一的显示样式有很大的必要。下面就是我经常用的全局样式,写样式时,不管三七二十一,先把这一段贴上去。 body, div, dl, dt, dd, ul, ol, li, hr, h1, h2, h3, h4, h5, h6, pre, code, form,fieldset, legend, input, textarea, p, blockquote, th, td, header, nav, aside, menu, figure, article, time, footer{ margin: 0; padding: 0; } body, p, form, ul, li{ list-style: none outside none; } body{     min-width:1002px;     font:12px “Podkova”,”微软雅黑”,Arial,Tahoma,Verdana,Helvetica,sans-serif;     color:#666; } img{     border:0;     outline:none } a{     blr:expression_r(this.onFocus=this.blur());     outline:none;     border:0;     cursor:pointer;     color:#666;     text-decoration:none; } a:active { outline: none; star:expression(this.onFocus=this.blur()); } area { blr:expression_r(this.onFocus=this.blur()) } button::-moz-focus-inner, input[type=”reset”]::-moz-focus-inner, input[type=”button”]::-moz-focus-inn …

>>Read more

Javascript 库,封装了一些常用函数

万年历

万年历

剪贴板粘贴图片自动上传服务器和又拍云

chrome支持剪贴板事件,因此,利用这个事件,完成剪贴板图片直接粘贴,并自动上传服务器功能。 另外就是对于最新版firefox,可以直接粘贴,不用任何处理。原理是按照base64编码,直接将图片数据存入img标签的src中。 是方便了编辑,但是在其他不支持base64为src的浏览器,比如低版本IE,就无法展示图片了。 所以为了兼容性,还是将图片上传到web服务器的好。 网上能支持图文混排的word文档粘贴的,都需要安装activeX控件,而且收费还比较贵。 在时间、金钱、需求之间取个平衡了~ 下面是修改步骤: admin/editor/kindeditor.js 末尾加上: $(document).ready(function(){ var KE =editorMap[‘content’]; if(KE){ if(KE.isEmpty()){ KE.insertHtml(‘Chrome下可直接粘贴图片,并自动上传服务器,欢迎体验~’); } KE.edit.doc.onpaste = function(event){ // console.log(‘content bind onpaste.’); // use event.originalEvent.clipboard for newer chrome versions var items = (event.clipboardData || event.originalEvent.clipboardData).items; console.log(JSON.stringify(items)); // will give you the mime types // find pasted image among pasted items var blob; for (var i = 0; i < items.length; i++) { if (items[i].type.indexOf(“image”) === 0) { blob = items[i].getAsFile(); } } // load image if there is a pasted image // console.log(blob); if (blob !== null && blob != undefined) …

>>Read more

Dot-B主题CSS样式

/* Theme Name: Dot-B

页面: 1 2 3 4 5 6

两款不错的表格样式

简洁,不错!

智能计算器

智能计算(支持JS Math函数)

智能计算器源码

源代码