网络服务

让Opera显示淘宝的图片

Written by ray on 2007/08/22 17:26
Opera一直是我首选的浏览器,除了网银要用IE外(不是IE好用,而是中国网银太烂,只支持IE,浦发的网银已经支持firefox了),基本都是用Opera的,Opera有很多人性化的地方,许多以IE为内核的浏览器的功能都是模仿Opera,Opera才是鼻祖,cool
不过Opera在浏览淘宝的时候不能显示宝贝的图片,总是显示服务器超时,非常不爽。
在网上还是找到了高人写的js脚本,顺便推广一下。grin

// ==UserScript==
// @name Show images - Taobao.com

// @author somh
// @ahmore@gmail.com
// @include http://auction1.taobao.com/auction*
// @20:41 2006-9-6

// ==/UserScript==

var h=window.location.href;

var sUrls="taobao.com/auction";
var iShown=0;
if(h.indexOf(sUrls) != -1) {
window.addEventListener('load',function(e){
   try {

    if(!iShown){
     var p = document.getElementById('FlashArea');
     var z = document.getElementById('ZoomInLink');
     var iUrl = "";for (var i = 0; i < imageUrl.length; ++i) { var code = imageUrl.charCodeAt(i); iUrl += String.fromCharCode(code ^ (i % 5)); }
     iUrl=picServer+"/"+iUrl;
     iObj=new Image();
     iObj.src=iUrl;
     z.href=iUrl;
     x=p.parentNode;

     x.removeChild(p);
     p=document.createElement('img');
     x.appendChild(p);
   
     document.styleSheets[0].insertRule("img.iMover { border: 1px solid #FF6600; padding: 1px; cursor: hand }", 0);
     document.styleSheets[0].insertRule("img.iMout     { border:1px dotted; padding:1px;cursor: pointer}", 0);
     loadImage=setInterval(function(){
      if(iObj.width>0 && iObj.height>0){
       p.src=iUrl;
       aw=350;ah=350;w=iObj.width; h=iObj.height; r=w/h;
       if(w>aw)w=aw;h=w/r; if(h>ah)h=ah;w=h*r;
       p.width=w;p.height=h;p.className="iMout";p.title=z.innerText;
       p.setAttribute("onclick","window.open(this.src);");
       p.setAttribute("onmouseover","this.className=\'iMover\';");
       p.setAttribute("onmouseout","this.className=\'iMout\';");
       delete iObj;
       clearInterval(loadImage);
       iShown=1;
      }
     },10)
    }
   }catch (e){}
},true);

}

分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]