- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
showimg.js
资源名称:shop.rar [点击查看]
上传用户:yatiankong
上传日期:2014-05-16
资源大小:5604k
文件大小:3k
源码类别:
Applet
开发平台:
Java
- var showFlag = false;
- var oldelm1;
- var timeElm ;
- function showBigImg(image, id, event)
- {
- if(navigator.userAgent.indexOf("Firefox")>0) //是Firefox浏览器
- {
- showBigImgFF(image, id, event);
- }
- else //包括微软在内的使用
- {
- showBigImgMS(image, id);
- }
- //if(isFirefox=navigator.userAgent.indexOf("Firefox")>0)return 2;
- }
- function showBigImgMS(image, id)
- {
- var elm1 = window.event.srcElement;
- showFlag = true;
- var beginShow = function() {BeginShow(elm1, image, id);}
- //alert(1);
- timeElm = window.setTimeout(beginShow, 550);
- }
- function BeginShow(elm1, image, id)
- {
- //var elm2 = window.event.srcElement;
- if( showFlag)
- {
- ShowInfo(elm1, image, id);
- }
- }
- function ShowInfo(elm1, image, id)
- {
- //<img src="images/head_01.jpg" />
- if(elm1 !=oldelm1)
- {
- RemoveElm('imgpanel');
- var str = '<div style="position:absolute; z-index:10 ;" id=imgpanel>';
- str += '<div style="position:absolute; border:#666666 1px solid; z-index:10 ;left:-4px;top:-10px ">';
- str +='<div style=" border:#E8E8E8 5px solid; padding:15px ; background-color:#FFFFFF ">';
- str +='<div style=" border:#B6B6B6 2px solid; " id=imgArea>';
- str +='<img src="product_image/' + image + '" id="num_' + id + '" /></div></div>';
- str +='<img src="js/arra.gif" style="position:absolute; z-index:2 ; left:-10px;top:12px" />';
- str +='</div></div>';
- var parentElm = elm1.parentNode;
- if(parentElm)
- {
- parentElm.innerHTML+=str;
- }
- var a = new Image();
- a.onload = function(){ var elm = document.getElementById("num_"+id); if(elm){elm.src = a.src}}
- a.src = "product_image/" + image;
- oldelm1 = elm1;
- }
- else
- {
- }
- }
- function RemoveElm(elmId)
- {
- try
- {
- var elm = document.getElementById(elmId);
- if(elm)elm.parentNode.removeChild(elm);
- }
- catch(e)
- {
- //alert('RemoveEml' + e.description);
- }
- }
- function mouseout(image)
- {
- try
- {
- RemoveElm('imgpanel');
- if(timeElm)
- {
- window.clearTimeout(timeElm);
- }
- }
- catch(e)
- {
- //alert('RemoveEml' + e.description);
- }
- }
- //-----------FF浏览器调用
- function showBigImgFF(image, id, event)
- {
- var elm1 = event.target;
- showFlag = true;
- var beginShow = function() {BeginShowFF(elm1, image, id);}
- //alert(1);
- timeElm = window.setTimeout(beginShow, 550);
- }
- function BeginShowFF(elm1, image, id)
- {
- //var elm2 = window.event.srcElement;
- if( showFlag)
- {
- ShowInfoFF(elm1, image, id);
- }
- }
- function ShowInfoFF(elm1, image, id)
- {
- //<img src="images/head_01.jpg" />
- if(elm1 !=oldelm1)
- {
- RemoveElm('imgpanel');
- var str = '<div style="position:absolute; z-index:10 ;" id=imgpanel>';
- str += '<div style="position:absolute; border:#666666 1px solid; z-index:10 ;left:80px;top:-70px ">';
- str +='<div style=" border:#E8E8E8 5px solid; padding:15px ; background-color:#FFFFFF ">';
- str +='<div style=" border:#B6B6B6 2px solid; " id=imgArea>';
- str +='<img src="product_image/' + image + '" id="num_' + id + '" border="0" /></div></div>';
- str +='<img src="js/arra.gif" style="position:absolute; z-index:2 ; left:-10px;top:12px" border="0" />';
- str +='</div></div>';
- var parentElm = elm1.parentNode;
- if(parentElm)
- {
- parentElm.innerHTML+=str;
- }
- var a = new Image();
- a.onload = function(){ var elm = document.getElementById("num_"+id); if(elm){elm.src = a.src}}
- a.src = "2/" + image;
- oldelm1 = elm1;
- }
- else
- {
- }
- }