查看商品图片,鼠标悬浮图片放大js实现

2010-06-07 10:18:46|分类:Javascript|字号订阅

<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%>

<%@pageimport="com.pojo.Products"%>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

DOCTYPEHTMLPUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<basehref="<%=basePath%>">

<title>My JSP 'buy.jsp' starting pagetitle>

head>

<scripttype="text/javascript">

functionshowing(imgpath){

varx=event.clientX;

vary=event.clientY;

document.getElementById("popup").innerHTML="+imgpath+"' width=200 height=200 />";

document.getElementById("popup").style.top=y+50;

document.getElementById("popup").style.left=x;

document.getElementById("popup").style.visibility="visible";

}

functionclearing(){

document.getElementById("popup").style.visibility="hidden";

}

script>

<body>

<%

Products p=(Products)request.getAttribute("procduct");

%>

商品名称:<%=p.getName()%><br/>

会员价:<%=p.getSaleprice()%><br/>

图片:<imgalt=""src="<%=p.getImange()%>"vspace="6"border="0"onmouseover="showing('<%=p.getImange()%>');"onmouseout="clearing();"><br/>

商品描述:<br/>

<textarearows="3"cols="15"disabled="disabled">

<%=p.getDescript()%>

textarea>

<formaction="">

数量:<inputname="count"size="2">

<inputtype="submit"value="购买">

form>

<divstyle="position: absolute; width:200; height:200; border:solid 1px; border-color: red; visibility: hidden; "id="popup">

123457789

div>

<br/>

<br/>

<br/>

<ahref="index.jsp?sid=<%=p.getSortp().getId()%>">返回商品列表a>

body>

html>

你可能感兴趣的:(查看商品图片,鼠标悬浮图片放大js实现)