Ⅰ HTML中怎么使鼠标悬停在图片上,使图片变大求代码解释。
<!DOCTYPEhtml>
<head>
<script>
window.onload=function(){
varimg=document.getElementById("imgTest");
if(document.addEventListener){
img.addEventListener("mouseover",doMouseover,false);
img.addEventListener("mouseout",doMouseout,false);
}
elseif(document.attachEvent){
img.attachEvent("mouseover",doMouseover);
img.attachEvent("mouseout",doMouseout);
}
else{
img.onmouseover=doMouseover;
img.onmouseout=doMouseout;
}
}
functiondoMouseover(){
this.width=this.width*1.5;
this.height=this.height*1.5;
}
functiondoMouseout(){
this.width=this.width/1.5;
this.height=this.height/1.5;
}
</script>
</head>
<body>
<imgid="imgTest"src="img/barcode.jpg"/>
</body>
</html>
Ⅱ 如何实现鼠标滑过,图片变大的效果。且图片变大后覆盖页面
这个要用jquery控制一下
这个大图片可以是一个层,然后隐藏起来。当经过小图的时候,获取小层的offset位置数值,然后赋值给大图,大图显示,基本上就是这原理,祝你成功
Ⅲ flash中,鼠标经过时,图片放大的代码是什么
鼠标经过图片放大,不需要代码。在场景一,你在标题栏上选择“插入”/“新建元件”,在弹出的对话框中,选择“按钮”,确定后,在“按钮”编辑舞台的“弹起”帧,导入一张图片,然后点击“指针经过”帧,“插入关键帧”,并把图片拉大,再在“点击”帧“插入帧”。回到场景一,把这个“按钮”元件拖到场景一,导出影片,测试效果。
Ⅳ 在html中怎么用js实现鼠标指向图片时图片放大到原图那么大(具体实现)
可以用js事件“onmouseover”和“onmouseout”来实现。
1、新建html文档,在body标签中添加图片标签,为这个标签设置“id”属性,然后设置图片的默认显示大小css属性:
Ⅳ 鼠标经过文字之后变大的CSS代码是多少
A.nav-h:hover {font-size: 14(这里加大于12的字号)px; color: #ff0000; text-decoration: none; line-height:170%}
Ⅵ 关于flash鼠标经过图片变大的效果,百度了几个代码都有问题,不会解决,希望高手能详细解答一下,谢谢~
this.button1.onPress = function() {
trace("放大");
with (_root.my_clip) {
_xscale += 10;
_yscale += 10;
}
};
this.button2.onPress = function() {
trace("缩小");
with (_root.my_clip) {
_xscale -= 10;
_yscale -= 10;
}
};
this.button3.onPress = function() {
trace("上");
with (_root.my_clip) {
_y -= 10;
}
};
this.button4.onPress = function() {
trace("下");
with (_root.my_clip) {
_y += 10;
}
};
this.button5.onPress = function() {
trace("左");
with (_root.my_clip) {
_x -= 10;
}
};
this.button6.onPress = function() {
trace("右");
with (_root.my_clip) {
_x += 10;
}
};
this.button7.onPress = function() {
trace("透明");
with (_root.my_clip) {
_alpha -= 10;
}
};
this.button8.onPress = function() {
trace("不透明");
with (_root.my_clip) {
_alpha += 10;
}
};
this.button9.onPress = function() {
trace("旋转");
with (_root.my_clip) {
_rotation += 10;
}
};
Ⅶ div+css鼠标指上时怎么让内容大小不变背景图片变大
background-size:200px 100px; 宽高自己定
如果让图片成比例放大,可以使用百分比,如 background-size:110%;
Ⅷ 急求鼠标经过图片变为另一张图片并放大效果的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<title>鼠标经过图片放大效果代码</title>
<style>
*{ padding:0; margin:0;}
html { overflow:-moz-scrollbars-vertical; }
body{ font:12px/22px "宋体"; word-break:break-all; text-align:left; background:#C0C0C0; color:#4E4E4E;}
ul,li{ list-style:none;}
a{ color:#333; text-decoration:none;}
a:hover{ color:#ff722d; text-decoration:none;}
img{ border:0;}
a img,a:hover img{ border:0;}
.latestWeb{ width:710px; margin:10px auto 0;}
.latestWeb ul{ overflow:hidden; _height:1%;}
.latestWeb li{ float:left; border:1px solid #EBEAEA; width:160px;margin:14px 15px 0 0; background:#fff }
.trans_msg
{
filter:alpha(opacity=100,enabled=1) revealTrans(ration=.2,transition=1) blendtrans(ration=.2);
}
div.bodycontent{font-family:Arial, Helvetica, sans-serif;padding:0 10px 10px 13px;color:#555;line-height:22px;text-align:justify;text-justify:inter-ideograph;}
div.bodycontent ul{margin-left:0px}
</style>
<script language="javascript">
function toolTip(str) {
}
</script>
<script language=JavaScript>
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){ //do this so I can take a string too
setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}
</script>
<style type="text/css">
<!--
.STYLE3 {color: #FFFFFF; font-size: 14px; }
-->
</style>
</head>
<body>
<div class="latestWeb">
<table width="707" bgcolor="#FFFFFF">
<tr>
<td width="355" bgcolor="#666666"><span class="STYLE3">以下是鼠标经过图片,跳出大图</span></td>
<td width="340" bgcolor="#666666"><span class="STYLE3">以下是鼠标经过图片,图片清晰</span></td>
</tr>
</table>
<ul>
<li>
<div><a href="#"><img src='/jscss/demoimg/201109/a.jpg ' alt="这里是文字说明" border="0" onMouseOver="toolTip('<img src=/jscss/demoimg/201109/a2.jpg>')" onMouseOut="toolTip()"></a></div>
</li>
<li>
<div><a href="#"><img src='/jscss/demoimg/201109/b.jpg ' alt="这里是文字说明" border="0" onMouseOver="toolTip('<img src=/jscss/demoimg/201109/b2.jpg>')" onMouseOut="toolTip()"></a></div>
</li>
<li>
<div><a href="#"><img src="/jscss/demoimg/201109/c.jpg" alt=这里是文字说明 border=0 style="FILTER: alpha(opacity=55)" onmouseover=nereidFade(this,100,3,5) onmouseout=nereidFade(this,50,3,5)></a></div>
</li>
<li>
<div><a href="#"><img src="/jscss/demoimg/201109/d.jpg" alt=这里是文字说明 border=0 style="FILTER: alpha(opacity=55)" onmouseover=nereidFade(this,100,3,5) onmouseout=nereidFade(this,50,3,5)></a></div>
</li>
</ul>
</div>
<script language="javascript" src="/jscss/demoimg/201109/ToolTip.js"></script>
</body>
</html>
Ⅸ 网页制作 当鼠标经过文字后字体会变大!在哪里写代码代码是什么!!
把要做特效的内容放到一个<a></a>标签里面,然后给它设置一个css样式:
a:hover{font-size:你想要的字体大小;}。
如果不想出现链接效果的话,可以把内容放到<span></span>标签,然后用span:hover{font-size:你想要的大小;}也行。这两种方法在IE7,8和Firefox上都可行。
如果要兼容杯具或者说餐具的IE6的话,只能用以下方法。
<a href="#" id="linkHover">你想出现效果的内容</a>
为了使得这个超链接表现得像普通文本内容,给这个超链接建立个样式如下:
a {color:Black; text-decoration:none;cursor:default;}
a.hover, a:hover { font-size:你想要的字体大小; }
之后再用一段JS给它动态增加css样式:
<script type="text/javascript">
<!--[if IE 6]>
document.getElementById('linkHover').onmouseover = function() {
this.className = "hover";
};
document.getElementById('linkHover').onmouseout = function() {
this.className = "";
}
<![endif]-->
</script>
至此,无论是Firefox,IE7,8还是杯具的IE6都能够得到想要的效果了。
Ⅹ 求html中把鼠标放在图片上图片能变大的代码 急急求大神
这个有很多方式实现
第一种:改变图片的宽和高
第二种:准备两张分辨率不同的图片来实现放大
第一种的好处就是简单,但是呢 效果不好 有锯齿
第二种的好处就是效果好 但是实现难度较大
第一种的实现方式我就不说了
第二种的实现方式实际上就是获取那张分辨率较小的图片的位置 然后按比例在分辨率较大的图片上截取 用css可以实现
具体实现 自己慢慢研究