js:
var num = 1;
function showImg() {
document.getElementById("divImg" + n).style.display = 'block';
}
function hideImg() {
document.getElementById("divImg" + n).style.display = 'none';
num++;
}
jsp:
<c:forEach items="${product}" var="product">
<tr>
<td><input type="checkbox" name="box" id=box <%=sum %>
value=${product.id } /></td>
<td>${product.id}</td>
<td><a href="javascript:void(0)" onMouseOut="hideImg()"
onmouseover="showImg()">${product.proName}</a>
<div id="divImg${product.id}" class="divClass"
style="display: none; height: 50px; back-ground: #f00; position: absolute;">
<img src="${basePath}/img/${product.img}">
</div></td>
<td>${product.number}</td>
<td class="am-hide-sm-only">${product.price}</td>
<td class="am-hide-sm-only">${product.des}</td>
<td>
[color=#FF99CC]js中怎么获取我标红了的ID值呢,因为不能直接 var num = ${product.id },所以怎么动态获取div中的值呢?求大牛帮助[/color]
var num = 1;
function showImg() {
document.getElementById("divImg" + n).style.display = 'block';
}
function hideImg() {
document.getElementById("divImg" + n).style.display = 'none';
num++;
}
jsp:
<c:forEach items="${product}" var="product">
<tr>
<td><input type="checkbox" name="box" id=box <%=sum %>
value=${product.id } /></td>
<td>${product.id}</td>
<td><a href="javascript:void(0)" onMouseOut="hideImg()"
onmouseover="showImg()">${product.proName}</a>
<div id="divImg${product.id}" class="divClass"
style="display: none; height: 50px; back-ground: #f00; position: absolute;">
<img src="${basePath}/img/${product.img}">
</div></td>
<td>${product.number}</td>
<td class="am-hide-sm-only">${product.price}</td>
<td class="am-hide-sm-only">${product.des}</td>
<td>
[color=#FF99CC]js中怎么获取我标红了的ID值呢,因为不能直接 var num = ${product.id },所以怎么动态获取div中的值呢?求大牛帮助[/color]
解决方案 »
- Hibernate读不到配置文件 Unable to read XML
- jsp文件下载问题:Connection reset by peer: socket write error
- lucene为pdf文件建立索引并搜索的问题
- IllegalStateException异常问题?
- swing 怎么提取jtable 一行的值
- 求jsp中session的用法???
- eclipse 调试时单步执行速度非常慢
- 求解一算法
- JBuilder X和JBuilder 9有什么不同
- 急救,请教TOMCAT下虚拟目录的问题,谢谢!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- spring-web包无法加载,导致项目无法启动
- 表格通过查询条件动态显示数据
35: var num = 1;
36: function showImg() {
37: document.getElementById("divImg${product.id}").style.display = 'block';
38: }
39: function hideImg() {
40: document.getElementById("divImg${product.id}").style.display = 'none';