<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[peswe的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/peswe</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; peswe]]></copyright><item><title><![CDATA[浏览器兼容]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4611471</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4611471</guid><author>peswe</author><pubDate>Mon, 28 Sep 2009 22:05:00 +0800</pubDate><description><![CDATA[这是我总结多年的一个小文档，最近看见有人咨询浏览器兼容的问题，就贡献出来。并不一定全，有的也可能不准确，比如新出的IE8、Chrome等都没有太多涉及，虽然最近做的一些项目也兼容了IE8、Chrome等，但都没来的及总结进去，后来就忘了...汗。大家一起慢慢完善吧。javascript部分1. document.form.item 问题问题：代码中存在 document.formName.item]]></description><category></category></item><item><title><![CDATA[为图片添加logo]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4581717</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4581717</guid><author>peswe</author><pubDate>Tue, 22 Sep 2009 21:55:00 +0800</pubDate><description><![CDATA[这里的添加logo只是在原图片上新建一个层，然后在新层上添加logo图片，这样既有logo水印的效果，也可以简单的防止别人之间单击右键下载图片首先在页面中添加一个图片： 然后获取图片的位置和长宽大小：var sample_pic = $(sample_pic)    if(!sample_pic) return;    var mask = $(mask)   ]]></description><category></category></item><item><title><![CDATA[rails错误——undefined method "paginate" for]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4556195</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4556195</guid><author>peswe</author><pubDate>Tue, 15 Sep 2009 20:51:00 +0800</pubDate><description><![CDATA[前几天将rails升级到2.3.2了，今天在用以前熟悉的分页函数paginate时提示undefined method "paginate" for ...一检查，发现在vendor里面装的居然是will_paginate而不是classic_paginate，汗；install classic_paginate后，又有新的错误：uninitialized constant Actio]]></description><category></category></item><item><title><![CDATA[固定定位实现滚动广告效果]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4513331</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4513331</guid><author>peswe</author><pubDate>Wed, 02 Sep 2009 22:38:00 +0800</pubDate><description><![CDATA[以前在论坛回帖的时候，写过一个滚动广告框的效果，代码如下： Scroll Box <!--var $ = function(id){return document.getElementById(id)}var box_init = function(){    var box = document.createElement(div);    box.setAt]]></description><category></category></item><item><title><![CDATA[doctype的影响]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4513226</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4513226</guid><author>peswe</author><pubDate>Wed, 02 Sep 2009 22:15:00 +0800</pubDate><description><![CDATA[以前转过一篇文章说的是css中可以用!important分别设置ie、firefox的样式，转之前我亲手测试过，绝对不会有假的但是今天当我再用这个方法的时候，却发现这个方法并没有效果：   <!--#test{background-color:green !important;background-color:blue;}-->#test{background-color:]]></description><category></category></item><item><title><![CDATA[自定义多级菜单]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4500797</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4500797</guid><author>peswe</author><pubDate>Sun, 30 Aug 2009 22:37:00 +0800</pubDate><description><![CDATA[每次进入cloudgamer的博客，看着他神奇般的实现各种绚丽的功能，就流口水，也想通过自己的代码来实现！~这两天终于抽出时间看了cloudgamer的博客，计划从简单的功能看起——自定义多级联动菜单(http://www.cnblogs.com/cloudgamer/archive/2008/06/28/1231557.html)看了很久的代码，终于看出些名堂了，我也模仿他的方法，写]]></description><category></category></item><item><title><![CDATA[contains、compareDocumentPosition判断元素位置关系]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4500548</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4500548</guid><author>peswe</author><pubDate>Sun, 30 Aug 2009 21:23:00 +0800</pubDate><description><![CDATA[在ie中使用contains可以很简单的判断一个元素是否包含另一个元素 New Document <!--var $ = function(id){return document.getElementById(id)}function function1() {   var m = $(myDiv).contains($(myB))    if (m =]]></description><category></category></item><item><title><![CDATA[知识点记录]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4496225</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4496225</guid><author>peswe</author><pubDate>Sat, 29 Aug 2009 11:32:00 +0800</pubDate><description><![CDATA[一旦把节点添加到document.body(或其后的节点)中，页面就会立即反映出这个变化。对于少量的更新，这是很好的。然而，当要向document.body添加大量数据时，如果逐个添加这些节点，这个过程有可能会十分缓慢。为解决这个问题，可以创建一个文档碎片，把所有的新节点附加其上，然后把文档碎片的内容一次性添加到document中。     假设你想创建十个新段落。你可能这样写：var arr]]></description><category></category></item><item><title><![CDATA[横向滚动]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4491515</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4491515</guid><author>peswe</author><pubDate>Thu, 27 Aug 2009 23:01:00 +0800</pubDate><description><![CDATA[在网上看到一个横向滚动的效果，看别人的代码写得比较好，但是有些看不懂，所以就自己写个类似的功能先总结下，有时间再去研究别人的代码主要原理：将原有的内容复制一份，并控制好滚动时，方块的位置，以达到无缝滚动的效果在界面中实际有20个方块， 方块1，方块2......方块19 ，方块20 经过复制后，就有40个方块了 方块1 ，方块2......方块19 ，方块2]]></description><category></category></item><item><title><![CDATA[ruby 导出xml]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4491132</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4491132</guid><author>peswe</author><pubDate>Thu, 27 Aug 2009 20:53:00 +0800</pubDate><description><![CDATA[今天有个任务，要求写个ruby文件，将数据导入到xml文件由于以前也经常做这样的导出，不过那个一般只涉及到单个数据表(而且是直接导入到excel中)，比较简单，所以就直接用ruby 连接到数据库了ENV[NLS_LANG] = SIMPLIFIED CHINESE_CHINA.AL32UTF8require "rubygems"gem "activerecord"req]]></description><category></category></item><item><title><![CDATA[css之!important]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4476282</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4476282</guid><author>peswe</author><pubDate>Sun, 23 Aug 2009 21:42:00 +0800</pubDate><description><![CDATA[ !important是CSS1就定义的语法，作用是提高指定样式规则的应用优先权(参见：W3.org的解释)。语法格式{ sRule!important }，即写在定义的最后面，例如：box{color:red !important;}最重要的一点是：IE一直都不支持这个语法，而其他的浏览器都支持。因此我们就可以利用这一点来分别给IE和其他浏览器不同的样式定义，例如，我们定义这样一个样]]></description><category></category></item><item><title><![CDATA[JavaScript replace new RegExp]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/4443929</link><guid>https://blog.youkuaiyun.com/peswe/article/details/4443929</guid><author>peswe</author><pubDate>Thu, 13 Aug 2009 18:27:00 +0800</pubDate><description><![CDATA[转载：http://hi.baidu.com/as_yy/blog/item/98dd0795de8f450a7af480b7.html今天没什么事做，把javascript中replace方法讲解一下，如果讲得不对或不合理是情理之中的事，因为我不是老鸟，也不是菜鸟，我也不知道我当底是什么鸟？？呵~~　　replace方法的语法是：stringObj.replace(rgExp, repl]]></description><category></category></item><item><title><![CDATA[clientX,clientY,x,y等的区别[转]]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/83365961</link><guid>https://blog.youkuaiyun.com/peswe/article/details/83365961</guid><author>peswe</author><pubDate>Wed, 25 Mar 2009 16:45:54 +0800</pubDate><description><![CDATA[clientX, clientY是鼠标当前相对于网页的位置，当鼠标位于页面左上角时clientX=0, clientY=0；
offsetX, offsetY是鼠标当前相对于网页中的某一区域的位置，当鼠标位于页面中这一区域的左上角时offsetX=0, offsetY=0；
screenX, screenY是相对于用户显示器的位置
x,y是鼠标相对于当前浏览器的位置


Measure...]]></description><category></category></item><item><title><![CDATA[arguments,caller,callee[转]]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/83365941</link><guid>https://blog.youkuaiyun.com/peswe/article/details/83365941</guid><author>peswe</author><pubDate>Wed, 25 Mar 2009 16:06:52 +0800</pubDate><description><![CDATA[在提到上述的概念之前，首先想说说javascript中函数的隐含参数：arguments

Arguments

该对象代表正在执行的函数和调用它的函数的参数。

[function.]arguments[n]
参数function ：选项。当前正在执行的 Function 对象的名字。 n ：选项。要传递给 Function 对象的从0开始的参数值索引。
说明

Argume...]]></description><category></category></item><item><title><![CDATA[08/1/8]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/83360544</link><guid>https://blog.youkuaiyun.com/peswe/article/details/83360544</guid><author>peswe</author><pubDate>Sun, 08 Mar 2009 09:49:18 +0800</pubDate><description><![CDATA[1,sysdate

oracle中表示今天的日期函数不是now()，而是sysdate

可在command window中，输入select sysdate from dual;产看当天的日期和时间

2，paginate_by_sql分页方法

传统的方法为：

@obj_pages,@objs = paginate_by_sql :talbe_name,:conditi...]]></description><category></category></item><item><title><![CDATA[08/1/7]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/83360543</link><guid>https://blog.youkuaiyun.com/peswe/article/details/83360543</guid><author>peswe</author><pubDate>Sun, 08 Mar 2009 09:48:15 +0800</pubDate><description><![CDATA[1、true,:selected=&gt;which_value_selected}%&gt;

2、mysql语句中可以直接利用case,if等控制流程函数进行搜索

case语句：

例：select case 1 when 1 then 'one' when 2 then 'two' else 'more' end;

  -&gt;'one'

在比较时不过要区分大小写，则可用binar...]]></description><category></category></item><item><title><![CDATA[mysql函数]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/83360542</link><guid>https://blog.youkuaiyun.com/peswe/article/details/83360542</guid><author>peswe</author><pubDate>Sun, 08 Mar 2009 09:47:17 +0800</pubDate><description><![CDATA[1、coalesce(a,b,c):返回参数列表中第一个不为null的参数
greatest(a,b,c):返回参数列表中最大的参数；
least（a,b,c)：返回参数列表中最小的

2、在mysql的逻辑判断中，处理常用的 and(&amp;&amp;),or(||)，还有xor，请功能是：比较的两个参数中，当有一个为null时，则返回null；
若比较的两个参数为数字，则当有一个数字为0则返回1，...]]></description><category></category></item><item><title><![CDATA[笔记6]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/83360541</link><guid>https://blog.youkuaiyun.com/peswe/article/details/83360541</guid><author>peswe</author><pubDate>Sun, 08 Mar 2009 09:46:06 +0800</pubDate><description><![CDATA[1、在模型中动态生成代码的函数module_eval

有时需要在模型中动态的生成一些函数，或需要重复的生成类似的函数，则用module_eval可以在很大程度上的优化代码

例如，在模型中要定义：

link_to_firm_function,link_to_contact_function,link_to_order_function,

用一般的方法，

def link...]]></description><category></category></item><item><title><![CDATA[08/12/31]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/83360540</link><guid>https://blog.youkuaiyun.com/peswe/article/details/83360540</guid><author>peswe</author><pubDate>Sun, 08 Mar 2009 09:45:17 +0800</pubDate><description><![CDATA[mysql中的一些用法：
1、user()：列出数据库的用户名；

version():列出mysql的版本；

current_date:当日日期；

now():当前时间；

show tables:列出数据库中所有的表名；

show database：列出所有的数据库；

describle table_name:列出表的列名，及列的类型等信息；

2、从文件...]]></description><category></category></item><item><title><![CDATA[08/12/30]]></title><link>https://blog.youkuaiyun.com/peswe/article/details/83360539</link><guid>https://blog.youkuaiyun.com/peswe/article/details/83360539</guid><author>peswe</author><pubDate>Sun, 08 Mar 2009 09:44:44 +0800</pubDate><description><![CDATA[一、date_select(object_name,method,options={},html_options={})
1、use_month_numbers
用法： :use_month_numbers=&gt;true
月份默认以英文形式显示，当该属性设置为true后，则以数字的形式显示；
2、start_year
用法： :start_year=&gt;1990
默认的起始年为当年减5年；...]]></description><category></category></item></channel></rss>