<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="http://feeds.qzone.qq.com/rss.xsl" version="1.0"?>
<rss version="2.0" xmlns:qz="http://qzone.qq.com">
<channel>
<title><![CDATA[.遊侠儿]]></title>
<description><![CDATA[遊侠兒de空间]]></description>
<link>http://280174196.qzone.qq.com</link>
<lastBuildDate>Thu, 26 Nov 2009 01:17:22 GMT</lastBuildDate>
<generator>Qzone</generator>
<language>zh-cn</language>
<copyright>Copyright (C), 2005-2008, Tencent Tech. Co., Ltd.</copyright>
<pubDate>Mon, 07 Sep 2009 14:58:44 GMT</pubDate>

<item>
<title><![CDATA[iframe 载入内容控制]]></title>
<link>http://280174196.qzone.qq.com/blog/1252335524</link>
<description><![CDATA[通过firame 来调用b.htm里面数据，并且实现无刷新稳定兼容IE/FF/SAFIRE<br><br><span style="font-weight:bold"><wbr />index.htm</span><wbr />&lt;iframe id=&quot;hidIframe&quot; onload=&quot;load_data();&quot; style=&quot;width:0px;height:0px&quot; width=&quot;0&quot; height=&quot;0&quot; name=&quot;hidIframe&quot; src=&quot;b.htm&quot;&gt;&lt;/iframe&gt;<br><br>&lt;div id=&quot;DataShow&quot;&gt;&lt;/div&gt;&lt;script&gt;<br>function load_data(){<br>var data = document.getElementById(&quot;hidIframe&quot;).contentWindow.document.body.innerHTML;<br>if(data){<br>   document.getElementById(&quot;DataShow&quot;).innerHTML = data;<br>}<br>}&lt;/script&gt;<br><span style="font-weight:bold"><wbr />b.htm</span><wbr />&lt;html&gt;<br>test info<br>&lt;/html&gt; <!--v:3.2--> ]]></description>
<category><![CDATA[学海沉舟]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1252335524#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Mon, 07 Sep 2009 14:58:44 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1252335524</guid>
</item>

<item>
<title><![CDATA[临渊羡鱼 不如退而结网]]></title>
<link>http://280174196.qzone.qq.com/blog/1250728929</link>
<description><![CDATA[ <br>          不必羡慕某同学买了车，不必嫉妒某朋友事业有成。临渊羡鱼，不如退而结网。<br>          出名要趁早，当然，早成晚成，相信早晚必有成。<br>          年轻虽是本钱，必定花光。<br>          美景良辰在前边。<br>          勇敢向前。<br> <!--v:3.2--> ]]></description>
<category><![CDATA[秃笔难言]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1250728929#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Thu, 20 Aug 2009 00:42:09 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1250728929</guid>
</item>

<item>
<title><![CDATA[烟雾中的迷失]]></title>
<link>http://280174196.qzone.qq.com/blog/1249219090</link>
<description><![CDATA[六岁的小姑娘罗舒拿走了我的烟盒，跑到阳台的跟我说,我要把烟盒扔下去。 <br>为什么？ <br>你要戒烟！ <br>⑤~⑤~ <br>小孩的认真而无邪的童语让我无言。是啊，说了多少次要戒烟的。却一直没有戒下来。抽得太多，最近的咽喉炎又来了，每天起床都感觉咽喉很刺痛。但还是照抽，每天都在烟雾里迷失。。。 <br>一颗红心，两片黑肺。我知道，照这样抽下去，早晚会落下病根来。我想，小孩的童声，唤醒了我，我要戒烟。不能再在烟雾的坠落了。 <br> <!--v:3.2--> ]]></description>
<category><![CDATA[个人日记]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1249219090#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Sun, 02 Aug 2009 13:18:10 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1249219090</guid>
</item>

<item>
<title><![CDATA[近日做flash一些小心得]]></title>
<link>http://280174196.qzone.qq.com/blog/1248929650</link>
<description><![CDATA[1、位图在动画缩放的时候出现锯齿边，解决方法： <br>      在库里选中位图，右键属性，勾选择“允许平滑”就搞定了多时困扰的问题了。  <br>2、少做场景，多做成影片剪辑，有利于减小生成的动画大小。影片剪辑还可以添加一些滤镜。 <br>  <br>3、做动画应该有一些“动感”的思维，如：反弹，散射，加/减速度，瞬移（消失、出现等），粒子效果，以及仿三维空间场景移动（这就做二维动画最难实现的）。还是要多去看别人的作品。领悟吧。 <br>  <br> <!--v:3.2--> ]]></description>
<category><![CDATA[学海沉舟]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1248929650#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Thu, 30 Jul 2009 04:54:10 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1248929650</guid>
</item>

<item>
<title><![CDATA[初试jQuery内容替换]]></title>
<link>http://280174196.qzone.qq.com/blog/1248677834</link>
<description><![CDATA[$(function(){ <br>   var rgb=$(&quot;div:contains('Ray Gold Board')&quot;); <br>   if(!rgb){return;} <br>   var bit=/ray gold board/gi; <br>   var newrgb=rgb.html().replace(bit,&quot;&lt;img src='images/r.jpg' /&gt;ay &lt;img src='images/g.jpg' /&gt;old &lt;img src='images/b.jpg' /&gt;oard&quot;); <br>   rgb.replaceWith(newrgb); <br>      });  <br>感觉还是比较好用，目前还没有写出不用JQuery的方法。 <!--v:3.2--> ]]></description>
<category><![CDATA[学海沉舟]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1248677834#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Mon, 27 Jul 2009 06:57:14 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1248677834</guid>
</item>

<item>
<title><![CDATA[设置防盗链]]></title>
<link>http://280174196.qzone.qq.com/blog/1247314519</link>
<description><![CDATA[利用Apache的mod_rewrite模块把盗链行为拒之门外。<span style="font-weight:bold"><wbr />利用.htaccess文件，设置图片mp3歌曲等的防盗链：</span><wbr /> <br>前提Apache中的mod_rewrite模块为激活状态，既然要消灭掉mp3文件的盗链就顺便也把图片盗链的设置给做了，下面是我在网站根目录的.htaccess文件中的配置，供同病相怜之人参考： <br><span style="font-weight:bold"><wbr />.htaccess文件中的代码：</span><wbr /> <br><span style="color:#ff0000;line-height:1.8em;">以下为引用的内容：</span><wbr /> <br><span style="font-family:'新宋体';line-height:1.8em;">RewriteEngine on <br>RewriteCond %{HTTP_REFERER} !^http://(www.)?islala.com/.*$ [NC] <br>RewriteRule .(txt|doc|jpg|gif|mp3|zip|rar|png)$ http://www.islala.com  <br>现在盗链的话，就会自动转向到我的主页。 <br>功能： <br>不仅屏蔽/禁止非本网站的盗链访问，还将盗链请求转给自身的网站，让读者知道谁是真正的原创作者。 <br>代码说明： <br>RewriteCond 条件：意思就是所有的mp3、rar、图片等，访问如果referer不是本网站islala.com或www.islala.com， <br>RewriteRule 规则：自动转向到本站主页： http://www.islala.com/ <br>注释掉的部分是测试rewrite engine用的：对于调试mod_rewrite很有用。 <br>其它防盗链的一些设置，大家可以参考： <br><span style="color:#ff0000;line-height:1.8em;">以下为引用的内容：</span><wbr /> <br><span style="font-family:'新宋体';line-height:1.8em;">#开启mod_rewrite引擎 <br>RewriteEngine On <br>#设置合法请求源 <br>RewriteCond %{HTTP_REFERER} !^$ [NC] <br>RewriteCond %{HTTP_REFERER} !zhangzhang.net [NC] <br>RewriteCond %{HTTP_REFERER} !google.com [NC] <br>RewriteCond %{HTTP_REFERER} !baidu.com [NC] <br>RewriteCond %{HTTP_REFERER} !yahoo.com [NC] <br>RewriteCond %{HTTP_REFERER} !msn.com [NC] <br>RewriteCond %{HTTP_REFERER} !bloglines.com [NC] <br>RewriteCond %{HTTP_REFERER} !feedburner.com [NC] <br>RewriteCond %{HTTP_REFERER} !feedsky.com [NC] <br>#指向警告页面 <br>RewriteRule .*\.(gif|jpg|png|mp3)$ outlink.gif [L,NC]</span><wbr /> <!--v:3.2--> ]]></description>
<category><![CDATA[学海沉舟]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1247314519#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Sat, 11 Jul 2009 12:15:19 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1247314519</guid>
</item>

<item>
<title><![CDATA[初试google map API为网站加张动态地图]]></title>
<link>http://280174196.qzone.qq.com/blog/1245231245</link>
<description><![CDATA[演示地址为：http://www.0fzl.com/advert/cn/index.html一般的公司在 联系我们的地方都会放上一张地图。大部分是截图。如果加张google map，做上个marker那多好。<br>首先我们到GG的map API那里去注册一个KEY;<br>我们在自己的网页的建一个div。并设好宽高和边框;加上ID=“ggmap”。<br>放JS代码：<br>&lt;script src=&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;sensor=true&amp;amp;key=ABQIAAAAVaH0HUYJdcFdMzgziY9VLBRVNMM2vqh4pniMifyojeHnp0RNEBSrH5sA2nO1axDxphtprGl3V5DfXg&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br>这里调用API的JS。在key后面加上自己在GG注册的ｋｅｙ。<br><br><br>下面是创建我们需要显示成的样子：<br>function addMap(){<br><span style="line-height:1.8em;"> </span><wbr />if(GBrowserIsCompatible()){<br><span style="line-height:1.8em;">  </span><wbr />var mapContainer = document.getElementById('ggmap');<br><span style="line-height:1.8em;">  </span><wbr />var map = new GMap2(mapContainer);<br><span style="line-height:1.8em;">  </span><wbr />map.addControl(new GSmallMapControl());<br><span style="line-height:1.8em;">  </span><wbr />map.addControl(new GMapTypeControl());<br><span style="line-height:1.8em;">  </span><wbr />map.addControl(new GScaleControl());<br><span style="line-height:1.8em;">  </span><wbr />var point= new GLatLng(22.63444,114.02103);<br><span style="line-height:1.8em;">  </span><wbr />map.setCenter(point,13);<br><span style="line-height:1.8em;">  </span><wbr />var marker=new GMarker(point);<br><span style="line-height:1.8em;">  </span><wbr />map.addOverlay(marker);<br><span style="line-height:1.8em;">  </span><wbr />var mssage=&quot;&lt;img src='http://www.advert.com.cn/images/advert-logo.jpg' /&gt;&lt;br /&gt;This is where Advert Technology&lt;br /&gt;China.ShenZhen.longhua.shantang&quot;;<br><span style="line-height:1.8em;">  </span><wbr />map.openInfoWindowHtml(point,mssage);<br><span style="line-height:1.8em;">  </span><wbr />}<br>}<br>addEvent(window,&quot;load&quot;,addMap);<br>addEvent(window,&quot;unload&quot;,GUnload);<br>更多详细的ＡＰＩ说明请参见http://code.google.com/intl/zh-CN/apis/maps/documentation/reference.html <!--v:3.2--> ]]></description>
<category><![CDATA[学海沉舟]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1245231245#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Wed, 17 Jun 2009 09:34:05 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1245231245</guid>
</item>

<item>
<title><![CDATA[ie下onresize事件处理难点：事件函数运行三次]]></title>
<link>http://280174196.qzone.qq.com/blog/1243654015</link>
<description><![CDATA[近日测试一个div满窗口，随窗口大小而缩放的页面。<br>用到onresize事件。在FF下没有问题，但是在IE下却出毛病了。事件函数运行三次。而且还会造成IE的假死。<br>不知道有什么好的方法处理没有。先放这里。找找再说！<br>function $(id){<br>return document.getElementById(id); <br>}<br>function init(){<br>var y=document.body.clientHeight;<br>var top=$('top').offsetHeight;<br>$('left').style.height=y-top+&quot;px&quot;;<br>$('right').style.height=y-top+&quot;px&quot;;<br>$('top').innerHTML=y+&quot;the top's height &quot;+top+&quot; ;the left's height &quot;+$('left').style.height+&quot;;the right's height &quot;+$('right').style.height;<br>}<br>window.onload=init;<br>window.onresize=init; <!--v:3.2--> ]]></description>
<category><![CDATA[学海沉舟]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1243654015#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Sat, 30 May 2009 03:26:55 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1243654015</guid>
</item>

<item>
<title><![CDATA[对DIV进行拖拽、缩放、锁定、删除四合一例子]]></title>
<link>http://280174196.qzone.qq.com/blog/1243607271</link>
<description><![CDATA[演示：<a href="http://0fzl.com/test/test_div_zoom.html" target="_blank">http://0fzl.com/test/test_div_zoom.html</a><wbr /><br>&lt;script type=&quot;text/javascript&quot;&gt;<br>var Class = {<br>//创建类<br> create : function () {<br>  return function () {<br>   this.initialize.apply(this, arguments);<br>  };<br> }<br>};<br>var $A = function (a) {<br>//转换数组<br> return a ? Array.apply(null, a) : new Array;<br>};<br>var $ = function (id) {<br>//获取对象<br> return document.getElementById(id);<br>};<br>var Try = {<br>//检测异常<br> these : function () {<br>  var returnValue, arg = arguments, lambda, i;<br>  for (i = 0 ; i &lt; arg.length ; i ++) {<br>   lambda = arg<span style="font-style:italic"><wbr />;<br>   try {<br>    returnValue = lambda();<br>    break;<br>   } catch (exp) {}<br>  }<br>  return returnValue;<br> }<br>};<br>Object.extend = function (a, b) {<br>//追加方法<br> for (var i in b) a<span style="font-style:italic"><wbr /> = b<span style="font-style:italic"><wbr />;<br> return a;<br>};<br>Object.extend(Object, {<br> addEvent : function (a, b, c, d) {<br> //添加函数<br>  if (a.attachEvent) a.attachEvent(b[0], c);<br>  else a.addEventListener(b[1] || b[0].replace(/^on/, &quot;&quot;), c, d || false);<br>  return c;<br> },<br> delEvent : function (a, b, c, d) {<br>  if (a.detachEvent) a.detachEvent(b[0], c);<br>  else a.removeEventListener(b[1] || b[0].replace(/^on/, &quot;&quot;), c, d || false);<br>  return c;<br> },<br> reEvent : function () {<br> //获取Event<br>  return window.event ? window.event : (function (o) {<br>   do {<br>    o = o.caller;<br>   } while (o &amp;&amp; !/^\[object[ A-Za-z]*Event\]$/.test(o.arguments[0]));<br>   return o.arguments[0];<br>  })(this.reEvent);<br> }<br>});<br>Function.prototype.bind = function () {<br>//绑定事件<br> var wc = this, a = $A(arguments), o = a.shift();<br> return function () {<br>  wc.apply(o, a.concat($A(arguments)));<br> };<br>};<br>var CDrag = Class.create();<br>CDrag.IE = /MSIE/.test(window.navigator.userAgent);<br>CDrag.load = function (obj_string, func, time) {<br>//加载对象<br> var index = 0, timer = window.setInterval(function () {<br>  try {<br>   if (eval(obj_string + &quot;.loaded&quot;)) {<br>    window.clearInterval(timer);<br>    func(eval(&quot;new &quot; + obj_string));<br>   }<br>  } catch (exp) {}<br>  if (++ index == 20) window.clearInterval(timer);<br> }, time + index * 3);<br>};<br>CDrag.database = {<br>//数据存储<br> json : null,<br> parse : function (id) {<br> //查找资源<br>  var wc = this, json = wc.json, i;<br>  for (i in json) {<br>   if (json<span style="font-style:italic"><wbr />.id == id)<br>    return json<span style="font-style:italic"><wbr />;<br>  }<br> }<br>};<br>CDrag.Ajax = Class.create();<br>Object.extend(CDrag.Ajax, {<br> getTransport: function() {<br>  return Try.these(<br>   function () { return new ActiveXObject('Msxml2.XMLHTTP') },<br>   function () { return new ActiveXObject('Microsoft.XMLHTTP') },<br>   function () { return new XMLHttpRequest() }<br>  ) || false;<br> }<br>});<br>CDrag.Ajax.prototype = {<br> initialize : function (url) {<br> //初始化<br>  var wc = this;<br>  wc.ajax = CDrag.Ajax.getTransport();<br> },<br> load : function (func) {<br>  var wc = this, ajax = wc.ajax;<br>  if (ajax.readyState == 4 &amp;&amp; ajax.status == 200)<br>   func(ajax.responseText);<br> },<br> send : function (url, func) {<br>  var wc = this, ajax = wc.ajax,<br>   querys = url + &quot;&amp;&quot; + new Date().getTime() + (10000 + parseInt(Math.random() * 10000));<br>  ajax.open(&quot;get&quot;, querys, true);<br>  ajax.onreadystatechange = wc.load.bind(wc, func);<br>  ajax.send(null);<br> }<br>};<br>CDrag.Table = Class.create();<br>CDrag.Table.prototype = {<br>//列的拖拽暂时不考虑<br> initialize : function () {<br> //初始化<br>  var wc = this;<br>  wc.items = []; //创建列组<br> },<br> add : function () {<br> //添加列<br>  var wc = this, id = wc.items.length, arg = arguments;<br>  return wc.items[id] = new CDrag.Table.Cols(id, wc, arg[0]);<br> }<br>};<br>CDrag.Table.Cols = Class.create();<br>CDrag.Table.Cols.prototype = {<br> initialize : function (id, parent, element) {<br> //初始化<br>  var wc = this;<br>  wc.items = []; //创建列组<br>  wc.id = id;<br>  wc.parent = parent;<br>  wc.element = element;<br> },<br> add : function () {<br> //添加行<br>  var wc = this, id = wc.items.length, arg = arguments;<br>  return wc.items[id] = new CDrag.Table.Rows(id, wc, arg[0], arg[1], arg[2]);<br> },<br> ins : function (num, row) {<br> //插入行<br>  var wc = this, items = wc.items, i;<br>  if (row.parent == wc &amp;&amp; row.id &lt; num) num --; //同列向下移动的时候<br>  for (i = num ; i &lt; items.length ; i ++) items<span style="font-style:italic"><wbr />.id ++;<br>  items.splice(num, 0, row);<br>  row.id = num, row.parent = wc; <br>  return row;<br> },<br> del : function (num) {<br> //删除行<br>  var wc = this, items = wc.items, i;<br>  if (num &gt;= items.length) return;<br>  for (i = num + 1; i &lt; items.length ; i ++) items<span style="font-style:italic"><wbr />.id = i - 1;<br>  return items.splice(num, 1)[0];<br> }<br>};<br>CDrag.Table.Rows = Class.create();<br>CDrag.Table.Rows.prototype = {<br> initialize : function (id, parent, element, window, locks) {<br> //初始化<br>  var wc = this, temp;<br>  wc.id = id;<br>  wc.parent = parent;<br>  wc.root_id = element;<br>  wc.window = window;<br>  wc.element = wc.element_init();<br>  temp = wc.element.childNodes[0];<br>  wc.title = temp.childNodes[4];<br>  wc.reduce = temp.childNodes[3];<br>  wc.lock = temp.childNodes[2], wc.locks = locks;<br>  wc.edit = temp.childNodes[1];<br>  wc.close = temp.childNodes[0];<br>  wc.content = wc.element.childNodes[1];<br>  wc.Class = wc.mousedown = wc.reduceFunc = wc.lockFunc = wc.editFunc = wc.closeFunc = null;<br>  wc.init();<br>  wc.load();<br> },<br> element_init : function () {<br> //初始化元素<br>  var wc = this, div = $(&quot;root_row&quot;).cloneNode(true);<br>  wc.parent.element.appendChild(div);<br>  div.style.display = &quot;block&quot;;<br>  return div;<br> },<br> init : function () {<br> //初始化信息<br>  var wc = this;<br>  if (wc.window == 0) {<br>   wc.content.style.display = &quot;none&quot;;<br>   wc.reduce.innerHTML = &quot;放大&quot;;<br>  } else {<br>   wc.content.style.display = &quot;block&quot;;<br>   wc.reduce.innerHTML = &quot;缩小&quot;;<br>  }<br>  wc.lock.innerHTML = !wc.locks ? &quot;锁定&quot; : &quot;解除&quot;;<br> },<br> load : function () {<br> //获取相关信息<br>  var wc = this, info = CDrag.database.parse(wc.root_id), script;<br>  wc.title.innerHTML = info.title;<br>  if (info.src) {<br>   wc.content.innerHTML = &quot;loading&quot;;<br>   script = document.createElement(&quot;script&quot;);<br>   script.src = info.src + &quot;.js&quot;//, script.defer = true;<br>   document.getElementsByTagName(&quot;head&quot;)[0].appendChild(script);<br>   CDrag.load(info.className, wc.upload.bind(wc), 5);<br>  } else wc.content.innerHTML = info.className;<br> },<br> upload : function (obj) {<br> /*加载类信息<br> 注：这里给行加入了一个扩展类，这里行的内容可以通过扩展类来控制^o^<br>不过扩展类的格式必须有open方法和edit方法，还有类名.静态成员loaded = true；为了检测是否加载完毕<br>扩展类需放到单独的.js文件里，然后从database结构体内设定其参数即可<br> */<br>  var wc = this;<br>  wc.Class = obj;<br>  wc.Class.parent = wc;<br>  wc.editFunc = Object.addEvent(wc.edit, [&quot;onclick&quot;], wc.lockF(wc.Class, wc.Class.edit, wc));<br>  wc.Class.open();<br> },<br> lockF : function () {<br> //检索锁定<br>  var wc = this, arg = $A(arguments), root = arg.shift(), func = arg.shift();<br>  return function () {<br>   if (!wc.locks) func.apply(root, arg.concat($A(arguments)));<br>  };<br> }<br>};<br>CDrag.Add = Class.create();<br>CDrag.Add.prototype = {<br> initialize : function (parent) {<br>  var wc = this;<br>  wc.div = document.createElement(&quot;div&quot;); //最外层div<br>  wc.iframe = document.createElement(&quot;iframe&quot;); //协助wc.div盖select的iframe<br>  wc.node = document.createElement(&quot;div&quot;); //内容底层div<br>  wc.content = document.createElement(&quot;div&quot;); //内容层div<br>  wc.button = document.createElement(&quot;button&quot;); //内容处理按钮<br>  wc.parent = parent;<br>  wc.json = null;<br>  wc.button.onclick = wc.execute.bind(wc, wc.content); //向按钮指向方法<br>  wc.init_element();<br> },<br> init_element : function () {<br>  var wc = this;<br>  wc.div.setAttribute(CDrag.IE ? &quot;className&quot; : &quot;class&quot;, &quot;Dall_screen&quot;);<br>  wc.iframe.setAttribute(CDrag.IE ? &quot;className&quot; : &quot;class&quot;, &quot;Iall_screen&quot;);<br>  wc.node.setAttribute(CDrag.IE ? &quot;className&quot; : &quot;class&quot;, &quot;Nall_screen&quot;);<br>  wc.content.setAttribute(CDrag.IE ? &quot;className&quot; : &quot;class&quot;, &quot;Call_screen&quot;);<br>  wc.button.innerHTML = &quot;执行&quot;;<br>  wc.node.appendChild(wc.content);<br>  wc.node.appendChild(wc.button);<br> },<br> init_json : function () {<br>  var wc = this, parent = wc.parent,<br>   cols = parent.table.items, new_json = {}, init_json = CDrag.database.json, r, i, j;<br>  for (i = 0 ; i &lt; init_json.length ; i ++) //便利原始数据<br>   new_json[init_json<span style="font-style:italic"><wbr />.id] = { id : init_json<span style="font-style:italic"><wbr />.id, row : null, title : init_json<span style="font-style:italic"><wbr />.title };<br>  for (i = 0 ; i &lt; cols.length ; i ++) //便利修改生成的串的属性<br>   for (r = cols<span style="font-style:italic"><wbr />.items, j = 0 ; j &lt; r.length ; j ++)<br>    new_json[r[j].root_id].row = r[j];<br>  return new_json;<br> },<br> init_node : function () {<br>  var wc = this, json = wc.json = wc.init_json(), boxary = [], i;<br>  for (i in json)<br>   boxary[boxary.length] = [<br>    '&lt;input type=&quot;checkbox&quot;', json<span style="font-style:italic"><wbr />.row ? 'checked=&quot;checked&quot;' : &quot;&quot;,<br>    ' value=&quot;', json<span style="font-style:italic"><wbr />.id, '&quot; /&gt;  ', json<span style="font-style:italic"><wbr />.title, '&lt;br \/&gt;'<br>   ].join(&quot;&quot;);<br>  wc.content.innerHTML = boxary.join(&quot;&quot;); //写入内容层<br> },<br> execute : function (div) {<br> //处理table类结构<br>  var wc = this, parent = wc.parent, json = wc.json, items = div.getElementsByTagName(&quot;input&quot;), row, c, i;<br>  try {<br>   for (i = 0 ; i &lt; items.length ; i ++) {<br>    if (items<span style="font-style:italic"><wbr />.type != &quot;checkbox&quot;) continue;<br>    row = json[items<span style="font-style:italic"><wbr />.value];<br>    if ((!!row.row) != items<span style="font-style:italic"><wbr />.checked) {<br>     if (row.row) parent.remove(row.row); //删除<br>     else parent.add(parent.table.items[0].add(row.id, 1, false)); //向第一行追加数据<br>     c = true;<br>    }<br>   }<br>   div.innerHTML = &quot;&quot;;<br>   if (c) parent.set_cookie();<br>  } catch (exp) {}<br>  wc.close();<br> },<br> add : function () {<br>  var wc = this, div = wc.div, iframe = wc.iframe;<br>  wc.init_node();<br>  div.style.height = iframe.style.height = Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight) + &quot;px&quot;;<br>  div.style.width = iframe.style.width = Math.max(document.documentElement.scrollWidth, document.documentElement.offsetWidth) + &quot;px&quot;;<br>  document.getElementsByTagName(&quot;html&quot;)[0].style.overflow = &quot;hidden&quot;;<br>  document.body.appendChild(iframe);<br>  document.body.appendChild(div);<br>  document.body.appendChild(wc.node);<br> },<br> close : function () {<br>  var wc = this, div = wc.div, iframe = wc.iframe;<br>  document.getElementsByTagName(&quot;html&quot;)[0].style.overflow = CDrag.IE ? &quot;&quot; : &quot;auto&quot;;<br>  document.body.removeChild(iframe);<br>  document.body.removeChild(div);<br>  document.body.removeChild(wc.node);<br> }<br>};<br>CDrag.prototype = {<br> initialize : function () {<br> //初始化成员<br>  var wc = this;<br>  wc.table = new CDrag.Table; //建立表格对象<br>  wc.addc = new CDrag.Add(wc); //建立添加对象<br>  wc.iFunc = wc.eFunc = null;<br>  wc.obj = { on : { a : null, b : &quot;&quot; }, row : null, left : 0, top : 0 };<br>  wc.temp = { row : null, div : document.createElement(&quot;div&quot;) };<br>  wc.temp.div.setAttribute(CDrag.IE ? &quot;className&quot; : &quot;class&quot;, &quot;CDrag_temp_div&quot;);<br>  wc.temp.div.innerHTML = &quot; &quot;;<br> },<br> reMouse : function (a) {<br> //获取鼠标位置<br>  var e = Object.reEvent();<br>  return {<br>   x : document.documentElement.scrollLeft + e.clientX,<br>   y : document.documentElement.scrollTop + e.clientY<br>  };<br> },<br> rePosition : function (o) {<br> //获取元素绝对位置<br>  var $x = $y = 0;<br>  do {<br>   $x += o.offsetLeft;<br>   $y += o.offsetTop;<br>  } while ((o = o.offsetParent)); // &amp;&amp; o.tagName != &quot;BODY&quot;<br>  return { x : $x, y : $y };<br> },<br> execMove : function (status, on_obj, in_obj, place) {<br> //处理拖拽过程细节<br>  var wc = this, obj = wc.obj.on, temp = wc.temp, px;<br>  obj.a = on_obj, obj.b = status;<br>  if (place == 0) {<br>  //向上<br>   px = in_obj.element.clientWidth;<br>   in_obj.element.parentNode.insertBefore(temp.div, in_obj.element);<br>  } else if (place == 1) {<br>  //新加入<br>   px = in_obj.element.clientWidth - 2;<br>   in_obj.element.appendChild(temp.div);<br>  } else {<br>  //向下<br>   px = in_obj.element.clientWidth;<br>   in_obj.element.parentNode.appendChild(temp.div);<br>  }<br>  wc.obj.left = Math.ceil(px / temp.div.offsetWidth * wc.obj.left); <br>temp.row.style.width = temp.div.style.width = px + &quot;px&quot;;  },<br> sMove : function (o) {<br>  var wc = this;<br>  if (o.locks || wc.iFunc || wc.eFinc) return;<br>  var mouse = wc.reMouse(), obj = wc.obj, temp = wc.temp, div = o.element, position = wc.rePosition(div);<br>  obj.row = o;<br>  obj.on.b = &quot;me&quot;;<br>  obj.left = mouse.x - position.x;<br>  obj.top = mouse.y - position.y;<br>  temp.row = document.body.appendChild(div.cloneNode(true)); //复制预拖拽对象<br>  temp.row.style.width = div.clientWidth + &quot;px&quot;;<br>  with (temp.row.style) {<br>   position = &quot;absolute&quot;;<br>   left = mouse.x - obj.left + &quot;px&quot;;<br>   top = mouse.y - obj.top + &quot;px&quot;;<br>   zIndex = 100;<br>   opacity = &quot;0.3&quot;;<br>   filter = &quot;alpha(opacity:30)&quot;;<br>  }<br>  with (temp.div.style) {<br>  //设置站位对象<br>   height = div.clientHeight + &quot;px&quot;;<br>   width = div.clientWidth + &quot;px&quot;;<br>  }<br>  div.parentNode.replaceChild(temp.div, div);<br>  wc.iFunc = Object.addEvent(document, [&quot;onmousemove&quot;], wc.iMove.bind(wc));<br>  wc.eFunc = Object.addEvent(document, [&quot;onmouseup&quot;], wc.eMove.bind(wc));<br>  document.onselectstart = new Function(&quot;return false&quot;);<br> },<br> iMove : function () {<br> //当鼠标移动时设置参数<br>  var wc = this, mouse = wc.reMouse(), cols = wc.table.items, obj = wc.obj, temp = wc.temp,<br>   row = obj.row, div = temp.row, t_position, t_cols, t_rows, i, j;<br>  with (div.style) {<br>   left = mouse.x - obj.left + &quot;px&quot;;<br>   top = mouse.y - obj.top + &quot;px&quot;;<br>  }<br>  for (i = 0 ; i &lt; cols.length ; i ++) {<br>   t_cols = cols<span style="font-style:italic"><wbr />;<br>   //if (t_cols != obj.row.parent) continue;<br>   t_position = wc.rePosition(t_cols.element);<br>   if (t_position.x &lt; mouse.x &amp;&amp; t_position.x + t_cols.element.offsetWidth &gt; mouse.x) {<br>    if (t_cols.items.length &gt; 0) { //如果此列行数大于0<br>     if (t_cols.items[0] != obj.row &amp;&amp; wc.rePosition(t_cols.items[0].element).y + 20 &gt; mouse.y) {<br>      //如果第一行不为拖拽对象并且鼠标位置大于第一行的位置即是最上。。<br>      //向上<br>      wc.execMove(&quot;up&quot;, t_cols.items[0], t_cols.items[0], 0);<br>     } else if (t_cols.items.length &gt; 1 &amp;&amp; t_cols.items[0] == row &amp;&amp;<br>      wc.rePosition(t_cols.items[1].element).y + 20 &gt; mouse.y) {<br>      //如果第一行是拖拽对象而第鼠标大于第二行位置则，没有动。。<br>      //向上<br>      wc.execMove(&quot;me&quot;, t_cols.items[1], t_cols.items[1], 0);<br>     } else {<br>      for (j = t_cols.items.length - 1 ; j &gt; -1 ; j --) {<br>       //重最下行向上查询<br>       t_rows = t_cols.items[j];<br>       if (t_rows == obj.row) {<br>        if (t_cols.items.length == 1) {<br>        //如果拖拽的是此列最后一行<br>         wc.execMove(&quot;me&quot;, t_cols, t_cols, 1);<br>        }<br>        continue;<br>       }<br>       if (wc.rePosition(t_rows.element).y &lt; mouse.y) {<br>        //如果鼠标大于这行则在这行下面<br>        if (t_rows.id + 1 &lt; t_cols.items.length &amp;&amp; t_cols.items[t_rows.id + 1] != obj.row) {<br>         //如果这行有下一行则重这行下一行的上面插入<br>         wc.execMove(&quot;down&quot;, t_rows, t_cols.items[t_rows.id + 1], 0);<br>        } else if (t_rows.id + 2 &lt; t_cols.items.length) {<br>         //如果这行下一行是拖拽对象则插入到下两行，即拖拽对象返回原位<br>         wc.execMove(&quot;me&quot;, null, t_cols.items[t_rows.id + 2], 0);<br>        } else {<br>         //前面都没有满足则放在最低行<br>         wc.execMove(&quot;down&quot;, t_rows, t_rows, 2);<br>        }<br>        return;<br>       }<br>      }<br>     }<br>    } else {<br>    //此列无内容添加新行<br>     wc.execMove(&quot;new&quot;, t_cols, t_cols, 1);<br>    }<br>   }<br>  }<br> },<br> eMove : function () {<br> //当鼠标释放时设置参数<br>  var wc = this, obj = wc.obj, temp = wc.temp, row = obj.row, div = row.element, o_cols, n_cols, number;<br>  if (obj.on.b != &quot;me&quot;) {<br>   number = (obj.on.b == &quot;down&quot; ? obj.on.a.id + 1 : 0);<br>   n_cols = (obj.on.b != &quot;new&quot; ? obj.on.a.parent : obj.on.a);<br>   o_cols = obj.row.parent;<br>   n_cols.ins(number, o_cols.del(obj.row.id));<br>   wc.set_cookie();<br>  }<br>  temp.div.parentNode.replaceChild(div, temp.div);<br>  temp.row.parentNode.removeChild(temp.row);<br>  delete temp.row;<br>  Object.delEvent(document, [&quot;onmousemove&quot;], wc.iFunc);<br>  Object.delEvent(document, [&quot;onmouseup&quot;], wc.eFunc);<br>  document.onselectstart = wc.iFunc = wc.eFunc = null;<br> },<br> reduce : function (o) {<br> //变大变小<br>  var wc = this;<br>  if ((o.window = (o.window == 1 ? 0 : 1))) {<br>   o.content.style.display = &quot;block&quot;;<br>   o.reduce.innerHTML = &quot;缩小&quot;;<br>  } else {<br>   o.content.style.display = &quot;none&quot;;<br>   o.reduce.innerHTML = &quot;放大&quot;;<br>  }<br>  wc.set_cookie();<br> },<br> lock : function (o) {<br>  var wc = this;<br>  if (o.locks) {<br>   o.locks = false;<br>   o.lock.innerHTML = &quot;锁定&quot;;<br>  } else {<br>   o.locks = true;<br>   o.lock.innerHTML = &quot;解除&quot;;<br>  }<br>  wc.set_cookie();<br> },<br> close : function (o) {<br>  var wc = this;<br>  wc.remove(o);<br>  wc.set_cookie();<br> },<br> remove : function (o) {<br>  var wc = this, parent = o.parent;<br>  Object.delEvent(o.close, [&quot;onclick&quot;], o.closeFunc);<br>  if (o.editFunc) Object.delEvent(o.edit, [&quot;onclick&quot;], o.editFunc);<br>  Object.delEvent(o.lock, [&quot;onclick&quot;], o.lockFunc);<br>  Object.delEvent(o.reduce, [&quot;onclick&quot;], o.reduceFunc);<br>  Object.delEvent(o.title, [&quot;onmousedown&quot;], o.mousedown);<br>  o.mousedown = o.reduceFunc = o.lockFunc = o.editFunc = o.closeFunc = null;<br>  parent.element.removeChild(o.element);<br>  parent.del(o.id);<br>  delete wc.Class;<br>  delete o;<br> },<br> create_json : function () {<br> //生成json串<br>  var wc = this, cols = wc.table.items, a = [], b = [], i, j, r;<br>  for (i = 0 ; i &lt; cols.length ; i ++) {<br>   for (r = cols<span style="font-style:italic"><wbr />.items, j = 0 ; j &lt; r.length ; j ++)<br>    b<span style="font-weight:bold"><wbr /> = &quot;{id:'&quot; + r[j].root_id + &quot;',window:&quot; + r[j].window + &quot;,locks:&quot; + r[j].locks + &quot;}&quot;;<br>   a[a.length] = &quot;cols:'&quot; + cols<span style="font-style:italic"><wbr />.element.id + &quot;',rows:[&quot; + b.splice(0, b.length).join(&quot;,&quot;) + &quot;]&quot;;<br>  }<br>  return escape(&quot;[{&quot; + a.join(&quot;},{&quot;) + &quot;}]&quot;);<br> },<br> parse_json : function (cookie) {<br> //解释json成对象<br>  return eval(&quot;(&quot; + cookie + &quot;)&quot;);<br> },<br> get_cookie : function () {<br>  return (/CDrag=([^;]+)(?:;|$)/.exec(document.cookie) || [,])[1];<br> },<br> set_cookie : function () {<br>  var wc = this, date = new Date;<br>  date.setDate(date.getDate() + 1);<br>  document.cookie = &quot;CDrag=&quot; + wc.create_json() + &quot;;expires=&quot; + date.toGMTString();<br> },<br> del_cookie : function () {<br>  var wc = this, cookie = wc.get_cookie(), date;<br>  if (cookie) {<br>   date = new Date;<br>   date.setTime(date.getTime() - 1);<br>   document.cookie = &quot;CDrag=&quot; + cookie + &quot;;expires=&quot; + date.toGMTString();<br>  }<br> },<br> parse : function (o) {<br> //初始化成员<br>  try {<br>   var wc = this, table = wc.table, cols, rows, div, i, j;<br>   for (i = 0 ; i &lt; o.length ; i ++) {<br>    div = $(o<span style="font-style:italic"><wbr />.cols), cols = table.add(div);<br>    for (j = 0 ; j &lt; o<span style="font-style:italic"><wbr />.rows.length ; j ++)<br>     wc.add(cols.add(o<span style="font-style:italic"><wbr />.rows[j].id, o<span style="font-style:italic"><wbr />.rows[j].window, o<span style="font-style:italic"><wbr />.rows[j].locks));<br>   }<br>  } catch (exp) {<br>   wc.del_cookie();<br>  }<br> },<br> add : function (o) {<br>  var wc = this;<br>  o.mousedown = Object.addEvent(o.title, [&quot;onmousedown&quot;], o.lockF(wc, wc.sMove, o));<br>  o.reduceFunc = Object.addEvent(o.reduce, [&quot;onclick&quot;], o.lockF(wc, wc.reduce, o));<br>  o.lockFunc = Object.addEvent(o.lock, [&quot;onclick&quot;], wc.lock.bind(wc, o));<br>  o.closeFunc = Object.addEvent(o.close, [&quot;onclick&quot;], o.lockF(wc, wc.close, o));<br> },<br> append : function () {<br>  var wc = this;<br>  wc.addc.add();<br> }<br>};<br>CDrag.database.json = [<br> { id : &quot;m_1_1&quot;, title : &quot;假如说某类新闻&quot;, className : &quot;News&quot;, src : &quot;News&quot; },<br> { id : &quot;m_1_2&quot;, title : &quot;第一列的第二个&quot;, className : &quot;第一列的第二个&quot;, src : &quot;&quot; },<br> { id : &quot;m_1_3&quot;, title : &quot;第一列的第三个&quot;, className : &quot;第一列的第三个&quot;, src : &quot;&quot; },<br> { id : &quot;m_1_4&quot;, title : &quot;第一列的第四个&quot;, className : &quot;第一列的第四个&quot;, src : &quot;&quot; },<br> { id : &quot;m_2_1&quot;, title : &quot;第二列的第一个&quot;, className : &quot;第二列的第一个&quot;, src : &quot;&quot; },<br> { id : &quot;m_2_2&quot;, title : &quot;第二列的第二个&quot;, className : &quot;第二列的第二个&quot;, src : &quot;&quot; },<br> { id : &quot;m_2_3&quot;, title : &quot;第二列的第三个&quot;, className : &quot;第二列的第三个&quot;, src : &quot;&quot; },<br> { id : &quot;m_2_4&quot;, title : &quot;第二列的第四个&quot;, className : &quot;第二列的第四个&quot;, src : &quot;&quot; },<br> { id : &quot;m_3_1&quot;, title : &quot;假如说某类图片&quot;, className : &quot;Pic&quot;, src : &quot;Pic&quot; },<br> { id : &quot;m_3_2&quot;, title : &quot;第三列的第二个&quot;, className : &quot;第三列的第二个&quot;, src : &quot;&quot; },<br> { id : &quot;m_3_3&quot;, title : &quot;第三列的第三个&quot;, className : &quot;第三列的第三个&quot;, src : &quot;&quot; },<br> { id : &quot;m_3_4&quot;, title : &quot;第三列的第四个&quot;, className : &quot;第三列的第四个&quot;, src : &quot;&quot; } <br>];<br>Object.addEvent(window, [&quot;onload&quot;], function () {<br> var wc = new CDrag, cookie = wc.get_cookie();<br>  json = cookie ? wc.parse_json(unescape(cookie)) : [<br>  { cols : &quot;m_1&quot;, rows : [<br>   { id : &quot;m_1_1&quot;, window : 1, locks : false },<br>   { id : &quot;m_1_2&quot;, window : 1, locks : false },<br>   { id : &quot;m_1_3&quot;, window : 1, locks : false }<br>  ] },<br>  { cols : &quot;m_2&quot;, rows : [<br>   { id : &quot;m_2_1&quot;, window : 1, locks : false },<br>   { id : &quot;m_2_2&quot;, window : 1, locks : false },<br>   { id : &quot;m_2_3&quot;, window : 1, locks : false }<br>  ] },<br>  { cols : &quot;m_3&quot;, rows : [<br>   { id : &quot;m_3_1&quot;, window : 1, locks : false },<br>   { id : &quot;m_3_2&quot;, window : 1, locks : false },<br>   { id : &quot;m_3_3&quot;, window : 1, locks : false }<br>  ] }<br> ];<br> wc.parse(json);<br> (function (wc) {<br>  $(&quot;DEL_CDrag&quot;).onclick = function () {<br>   wc.del_cookie();<br>   window.location.reload();<br>  };<br>  $(&quot;ADD_CDrag&quot;).onclick = function () {<br>   wc.append();<br>  };<br> })(wc);<br> wc = null;<br>});<br>&lt;/script&gt; <!--v:3.2--> ]]></description>
<category><![CDATA[学海沉舟]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1243607271#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Fri, 29 May 2009 14:27:51 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1243607271</guid>
</item>

<item>
<title><![CDATA[点击图片链接直接弹出保存操作]]></title>
<link>http://280174196.qzone.qq.com/blog/1243580440</link>
<description><![CDATA[<span style="color:#000000;line-height:1.8em;">&lt;!doctype html public &quot;-//w3c//dtd xhtml 1.0 transitional//en&quot; &quot;</span><wbr /><a href="http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd" target="_blank"><span style="color:#000000;line-height:1.8em;">http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd</span><wbr /></a><wbr /><span style="color:#000000;line-height:1.8em;">&quot;&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;meta http-equiv=&quot;content-language&quot; content=&quot;zh-cn&quot;&gt;<br>&lt;meta name=&quot;author&quot; content=&quot;forfor&quot;&gt;<br>&lt;title&gt; Test Document &lt;/title&gt;<br>&lt;script type=&quot;text/javascript&quot;&gt;<br>&lt;!--<br>function runSave(){<br>if (saveImg.location != &quot;about:blank&quot;)window.saveImg.document.execCommand(&quot;SaveAs&quot;);<br>}<br>function saveImgAs(url){<br>if(window.saveImg &amp;&amp; url)window.saveImg.location=url;<br>}<br>//--&gt;<br>&lt;/script&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;a href=&quot;#&quot; onclick=&quot;saveImgAs('1.jpg')&quot;&gt;1&lt;/a&gt;<br>&lt;a href=&quot;#&quot; onclick=&quot;saveImgAs('2.jpg')&quot;&gt;1&lt;/a&gt;<br>&lt;iframe src=&quot;about:blank&quot; name=&quot;saveImg&quot; onload=&quot;runSave()&quot; style=&quot;display:none;&quot;&gt;&lt;/iframe&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</span><wbr /> <!--v:3.2--> ]]></description>
<category><![CDATA[学海沉舟]]></category>
<author><![CDATA[280174196@qq.com(.遊侠儿)]]></author>
<comments>http://280174196.qzone.qq.com/blog/1243580440#comment</comments>
<qz:effect>142606848</qz:effect>
<pubDate>Fri, 29 May 2009 07:00:40 GMT</pubDate>
<guid>http://280174196.qzone.qq.com/blog/1243580440</guid>
</item>

</channel>
</rss>

