📄 sendpicjs.htm
字号:
<!--
var caishow_f = 2526;
var XCMenu = null;
var XCMinWidth = 160;
var XCMinHeight = 160;
var XCCuteCheckImgSrc = true;
//XCSetupMenu(document);
function openSendWindow(picUrl,type) {
var httpindex = picUrl.lastIndexOf("http://");
var rurl = picUrl;
if (httpindex != -1) {
rurl = rurl.substring(httpindex, rurl.length);
}
if (type == 'small') {
window.open("http://www.caishow.com/cooperation/pic.asp?f=" + caishow_f + "&picUrl=" + rurl,"CaishowSendWindow",null);
}
if (type == 'big') {
window.open("http://www.caishow.com/cooperation/bigPic.asp?f=" + caishow_f + "&picUrl=" + rurl,"CaishowSendWindow",null);
}
}
if(document.readyState=="complete")
{
XCSetupMenu(document);
}
else
{
document.onreadystatechange = function()
{
if(document.readyState=="complete")
{
XCSetupMenu(document);
}
}
}
//if(parent!=window)
//{
// if(parent.document.readyState=="complete")
// {
// XCSetupMenu(parent.document);
// }
// else
// {
// parent.document.onreadystatechange = function()
// {
// if(document.readyState=="complete")
// {
// XCSetupMenu(parent.document);
// }
// }
// }
//}
function XCSetupMenu(doc)
{
if(typeof(doc.XCMenu)=="undefined")
{
doc.XCMenu = null;
doc.XCMinWidth = XCMinWidth;
doc.XCMinHeight = XCMinHeight;
doc.XCCuteCheckImgSrc = XCCuteCheckImgSrc;
}
for(var i = 0; i<doc.images.length; ++i)
{
var img = doc.images[i];
if(typeof(img.orig_onmouseover)=="undefined")
{
img.orig_onmouseover = img.onmouseover;
img.orig_onmouseout = img.onmouseout;
}
img.onmouseover = XCRollOver;
img.onmouseout = XCRollOut;
}
}
function XCRollOver()
{
if(this.orig_onmouseover)
{
this.orig_onmouseover();
}
var doc = this.document;
if(!doc.XCMenu)
{
doc.XCMenu = doc.createElement("A");
doc.XCMenu.id = "XCSendIMG";
doc.XCMenu.style.color = "black";
doc.XCMenu.style.fontFamily = "宋体";
doc.XCMenu.style.fontSize = "9pt";
doc.XCMenu.style.border = "solid 1px black";
doc.XCMenu.style.backgroundColor = "yellow";
doc.XCMenu.innerHTML = "发送此图片到手机";
doc.XCMenu.style.padding = "3px";
doc.XCMenu.target = "_blank";
doc.XCMenu.style.position = "absolute";
doc.XCMenu.style.visibility = "hidden";
doc.XCMenu.onmouseout = function()
{
this.style.visibility = "hidden";
}
}
doc.body.insertAdjacentElement("BeforeEnd", doc.XCMenu);
if(this.width>=doc.XCMinWidth&&this.height>=doc.XCMinHeight)
{
var x = 100, y = 100;
for(var obj = this; obj; obj = obj.offsetParent)
{
x += parseInt(obj.offsetLeft);
y += parseInt(obj.offsetTop);
}
doc.XCMenu.href = "JavaScript:openSendWindow('" + ValueEncode(XCCalcSrc(this,doc.XCCuteCheckImgSrc)) + "','big');";
doc.XCMenu.target = "_self";
doc.XCMenu.style.left = x; //Math.max(x, stgcl(doc));
doc.XCMenu.style.top = y; //Math.max(y, stgct(doc));
doc.XCMenu.style.visibility = "";
}
if (this.width>=80&&this.height>=80&&this.width<=160&&this.height<=160) {
var x = 0, y = 0;
for(var obj = this; obj; obj = obj.offsetParent)
{
x += parseInt(obj.offsetLeft);
y += parseInt(obj.offsetTop);
}
doc.XCMenu.href = "JavaScript:openSendWindow('" + ValueEncode(XCCalcSrc(this,doc.XCCuteCheckImgSrc)) + "','small');";
doc.XCMenu.target = "_self";
doc.XCMenu.style.left = x; //Math.max(x, stgcl(doc));
doc.XCMenu.style.top = y; //Math.max(y, stgct(doc));
doc.XCMenu.style.visibility = "";
}
}
function XCRollOut()
{
var doc = this.document;
if(doc.XCMenu)
{
if(this.orig_onmouseout)
{
this.orig_onmouseout();
}
var e = this.document.parentWindow.event;
if(e.toElement&&e.toElement.id == "XCSendIMG")
{
return ;
}
doc.XCMenu.style.visibility = "hidden";
}
}
function XCCalcSrc(img,CuteCheckImgSrc)
{
var ext = "";
var href = "";
for(var obj=img; obj&&CuteCheckImgSrc; obj = obj.parentElement)
{
if(obj.tagName=="A")
{
href = obj.href;
ext = getextension(href).toLowerCase();
break;
}
}
return ext==".jpg"||ext==".jpeg"||ext==".jpe"||ext==".gif"||ext==".png" ? href : img.src;
}
function getextension(s)
{
var n=s.lastIndexOf('.');
return n<0 ? "" : s.substring(n,s.length);
}
function ValueEncode(s)
{
var r =s;
r = r.replace(/%/gi, "%25");
r = r.replace(/ /gi, "%20");
r = r.replace(/\t/gi, "%09");
r = r.replace(/#/gi, "%23");
r = r.replace(/\{/gi, "%7B");
r = r.replace(/\}/gi, "%7D");
r = r.replace(/\^/gi, "%5E");
r = r.replace(/~/gi, "%7E");
r = r.replace(/\[/gi, "%5B");
r = r.replace(/\]/gi, "%5D");
r = r.replace(/;/gi, "%3B");
r = r.replace(/@/gi, "%40");
r = r.replace(/=/gi, "%3D");
r = r.replace(/&/gi, "%26");
r = r.replace(/`/gi, "%60");
return r;
}
function stgcl(doc)
{
if (doc == null)
return 0;
if (doc.body == null)
return 0;
//if (typeof(doc.documentElement) == 'undefined' || doc.documentElement == null)
return doc.body.scrollLeft;
return doc.documentElement.scrollLeft;
}
function stgct(doc)
{
if (doc == null)
return 0;
if (doc.body == null)
return 0;
//if (typeof(doc.documentElement) == 'undefined' || doc.documentElement == null)
return doc.body.scrollTop;
return doc.documentElement.scrollTop;
}
//-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -