想实现的功能效果是在一张图片上 鼠标移上去图片就变大,鼠标移开了 图片变回原样。大虾本请问用jquery 怎么实现。$("#imagesid").mouseover(function(){
$(this).css{width:'500px;', height:'900px;'};
}); <a href="#"><img src="1.jpg" style="height:65px; width:132px;" id="imagesid"/></a>我上面写的报错,不行。
$(this).css{width:'500px;', height:'900px;'};
}); <a href="#"><img src="1.jpg" style="height:65px; width:132px;" id="imagesid"/></a>我上面写的报错,不行。
解决方案 »
- 多语言网站 大家都怎么处理???
- 该怎么改?SQL的问题。。。
- 初学Luncece的一些不解?
- tomcat启动后经常有java.sql.SQLException
- jsp jervlet 第一次允许的问题
- 如何在Tomcat中指定log文件的位置(使用log4j输出log信息)???
- JsonArray.fromObject()出错,提示session关闭
- redhat8.0+weblogic8.0+oracle9i插入数据库时,中文是乱码,该如何处理?
- 问题:为什么出现如下异常:com.sun.tools.javac.Main is not on the classpath.
- J2EE、JavaONE 是什么 ?
- 用axis2 和 hibernate 开Webservice出现 org.apache.axis2.AxisFault
- 第一次用zTree,请高手指教
$(this).css{"width":"500px;", "height":"900px;"};
});
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
function test(){
var test = document.getElementById("test");
test.style.width = "500px";
test.style.height = "500px";
};
function test2(){
var test = document.getElementById("test");
test.style.width = "50px";
test.style.height = "50px";
};
</script>
</head>
<body>
<img id="test" src="pic/2.jpg" onmouseover="test();" style="width: 50px; height: 50px" onmouseout="test2()"/>
</body>
</html>
<html>
<head>
<script src="jquery.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>$(document).ready(function(){
$("#imagesid").mouseover(function(){
$(this).data('oldwidth',$(this).css('width'));
$(this).data('oldheight',$(this).css('height'));
$(this).css('width','500px');
$(this).css('height','900px');
});
$("#imagesid").mouseout(function(){
var width = $(this).data('oldwidth');
var height = $(this).data('oldheight');
$(this).css('width',width);
$(this).css('height',height);
});
});
</script>
</head> <body> <div style="height:65px; width:132px;" id="imagesid">
<a href="#"><img src="1.jpg" style="height:100%;width:100%"/></a>
</div></table>
</body>
</html>
<html>
<head>
<script src="jquery.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>$(document).ready(function(){
$("#imagesid").mouseover(function(){
$(this).data('oldwidth',$(this).css('width'));
$(this).data('oldheight',$(this).css('height'));
$(this).css('width','500px');
$(this).css('height','900px');
});
$("#imagesid").mouseout(function(){
var width = $(this).data('oldwidth');
var height = $(this).data('oldheight');
$(this).css('width',width);
$(this).css('height',height);
});
});
</script>
</head> <body> <div style="height:65px; width:132px;" id="imagesid">
<a href="#"><img src="1.jpg" style="height:100%;width:100%"/></a>
</div></table>
</body>
</html>
$("#imagesid").css("width","500px","height","900px");
});
});或者:$("#imagesid").mouseover(function(){
$("#imagesid").css({"width":"500px","height":"900px"});
});
});