用onmouseover事件怎样实现。谢谢!!
...PictureBox1_MouseEnter ...............
{
this.PictureBox1.Image = ImageList1.Images[0];
}
...PictureBox1_MouseLeave...............
{
this.PictureBox1.Image = ImageList1.Images[1]
}
...PictureBox1_MouseEnter ...............
{
this.PictureBox1.Image = ImageList1.Images[0];
}
...PictureBox1_MouseLeave...............
{
this.PictureBox1.Image = ImageList1.Images[1]
}
在web程序中有这样的事件吗?我怎么不记得,我看看去
[CODE]<html>
<head><title>aaa</title></head>
<body>
<script type="text/javascript">
function init() {
if (!document.getElementById) return
var imgOriginSrc;
var imgTemp = new Array();
var imgarr = document.getElementsByTagName('img');
for (var i = 0; i < imgarr.length; i++) {
if (imgarr[i].getAttribute('hsrc')) {
imgTemp[i] = new Image();
imgTemp[i].src = imgarr[i].getAttribute('hsrc');
imgarr[i].onmouseover = function() {
imgOriginSrc = this.getAttribute('src');
this.setAttribute('src',this.getAttribute('hsrc'))
}
imgarr[i].onmouseout = function() {
this.setAttribute('src',imgOriginSrc)
}
}
}
}
onload=init;
</script>
<img src="200206044.jpg" hsrc="未命名.bmp">
</body>
</html>[/CODE]
红色部份是你要交换的两张图片.
开始发的是C/S里面的代码,不好意思.