代码改变世界

jquery 遮罩效果2

2012-06-06 20:35 by yangpan, 226 阅读, 0 推荐, 收藏, 编辑
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf- 阅读全文

jquery 遮罩效果

2012-06-06 20:15 by yangpan, 213 阅读, 1 推荐, 收藏, 编辑
摘要:$(function(){ $("#bt").click(function(){ var cover=$("<div></div>"); var obj={ 'background':'#000000', 'position':'absolute', 'top':'0px', 'bottom':'0px', 'left':'0px', 'right': 阅读全文

使用<style>标签插入页面样式:

2012-06-01 14:24 by yangpan, 507 阅读, 0 推荐, 收藏, 编辑
摘要:这种方式在各个主流浏览器存在兼容性问题,像firefox等标准浏览器无法直接获取设置styleSheet的cssText值,标准浏览器下只能使用document.styleSheets[0].cssRules[0].cssText单个获取样式;同时使用:document.styleSheets[0].cssRules[0].cssText=newcssText;页面不会自动更新样式,必须使用:document.styleSheets[0].cssRules[0].style.cssText=newcssText;这点似乎没坑爹的IE来的function&nbsp;includeStyl 阅读全文

为ecshop加上IP屏蔽功能,限制ip访问

2012-05-31 11:28 by yangpan, 231 阅读, 0 推荐, 收藏, 编辑
摘要:1. includes文件夹下新建ip.php文件,内容为:getIpAdr($thisip);$thenetip=get_netip($thisip); for($i=0;$i2. includes文件夹下新建ip.txt空白文本文档 3. 根目录下新建error.php,内容为:错误,您的IP不在本站的服务范围之内。 抱歉,您的IP地址不在本站的服务范围之内!请联系网站管理员。 Sorry, your IP address is not within the scope of the services this site! Please contact the w... 阅读全文

css3的阴影

2012-05-31 11:18 by yangpan, 258 阅读, 0 推荐, 收藏, 编辑
摘要:使用的两个CSS3属性:box-shadow、transform,基本语法: box-shadow box-shadow:5px 2px 6px #000; 数值从左至右:阴影水平偏移值(正值向右,负值向左);阴影垂直偏移值(正值向下,负值向上);阴影模糊值;阴影颜色。 transform transform的效果很多,这里只用了旋转: transform: rotate(-3deg) 数值表示旋转的角度,正值为顺时针,负值为逆时针。 因为CSS3还是草案,所以现有浏览器的最新版都是以私有属性来支持transform,需要加上-webkit-、-moz-、-o-、-ms- 具体实现思路:为了突 阅读全文

javascript的面向对象

2012-05-29 16:58 by yangpan, 151 阅读, 0 推荐, 收藏, 编辑
摘要:<script>//定义js的user对象function User(name,age){ this.name=name; this.age=age;this.getName=function(){return this.name;}this.getAge=function(){ return this.age;}}//实例化一个对象var use=new User("aa",21);alert(use.name);alert(use.getAge());//js对象继承在面向对象的编程方法中,对象继承是必不可少的,那么怎么在javascript中实现继承机制呢 阅读全文

jquery设置改变div背景

2012-05-28 13:59 by yangpan, 536 阅读, 0 推荐, 收藏, 编辑
摘要:View Code 1 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 2 3 <head> 4 5 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 6 7 <title>jQueryPad Preview</title> 8 9 <script type="text/javascr 阅读全文

js的面对对象的设计。

2012-05-28 10:59 by yangpan, 202 阅读, 0 推荐, 收藏, 编辑
摘要:function Abstarct(id){ this.containerHolder = null; if(typeof(id) == 'string') { this.containerHolder = $("#" + id); } else { this.containerHolder = id; } this.eventResponse = function(eventObj) { } }function map(id){ this.base=Abstarct; //继承Abstarct this.base(id); //调用构造方法} 阅读全文

js对图片的拖动和缩放

2012-05-28 10:26 by yangpan, 161 阅读, 0 推荐, 收藏, 编辑
摘要: 阅读全文

js中event.x,event.clientX,event.offsetX区别

2012-05-28 10:22 by yangpan, 306 阅读, 0 推荐, 收藏, 编辑
摘要:x:设置或者是得到鼠标相对于目标事件的父元素的外边界在x坐标上的位置。clientX:相对于客户区域的x坐标位置,不包括滚动条,就是正文区域。offsetx:设置或者是得到鼠标相对于目标事件的父元素的内边界在x坐标上的位置。screenX:相对于用户屏幕 阅读全文