引用
一个人的夜 的 鼠标点亮图片
使用方法:
1.把原始代码中的http://photo4.hexun.com/p/2006/1221/64375/t150_2AFE30838DB26103064B2C91979710BC.jpg(说明:换成对应的图片地址)换成您自己对应的图片地址。图片地址的查找方法:鼠标右键点击图片---属性---地址(URL)后面的地址就是图片地址。
2.把换好的原始代码直接放到自定义HTML模块里面即可
原始代码:
<style>
<!--#myimage{
filter:light
}-->
</style>
<img src="http://photo4.hexun.com/p/2006/1221/64375/t150_2AFE30838DB26103064B2C91979710BC.jpg" width="300" height="200">
<script language="JavaScript1.2">s = 50; // the size of the spotlight
vp = 10; // the visibility percent of the picture
startx = 0; // the top position of your sportlight into the image (on start)
starty = 0; // the left position of your spotlight into the image (on start)
//////////////////////////////////////////////////////////////////
// No need to edit below this line //
//////////////////////////////////////////////////////////////////var IE = document.all?true:false
function moveL()
{
xv = tempX;
yv = tempY;
myimage.filters.light.MoveLight(1,xv,yv,s,true);
}if (IE&&myimage.filters)
document.all.myimage.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0
function getMouseXY(e) {
tempX = event.offsetX
tempY = event.offsetYif (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
if (t)
{
moveL();
}return true
}var xv = startx;
var yv = starty;
var t= true;
if (IE&&myimage.filters){
myimage.style.cursor="hand";
myimage.filters.light.addAmbient(255,255,255,vp)
myimage.filters.light.addPoint(startx,starty,s,255,255,255,255)
}</script>
希望大家能够喜欢!如果喜欢的话,那就给我留言告诉我吧!你的鼓励是我前进的最大动力!
以后我会陆续介绍很多博客制作方法和小技巧,希望大家有时间常来看看,
一起交流学习!
评论