求一个网页图片显示特效

   更新日期:2024.05.19
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>byzuo.cn---焦点图片 </title>
<style type="text/css">
/* Reset style */
* { margin:0; padding:0; word-break:break-all; }
body { background:#FFF; color:#333; font:12px/1.6em Helvetica, Arial, sans-serif; }
h1, h2, h3, h4, h5, h6 { font-size:1em; }
a { color:#039; text-decoration:none; }
a:hover { text-decoration:underline; }
ul, li { list-style:none; }
fieldset, img { border:none; }
em, strong, cite, th { font-style:normal; font-weight:normal; }
/* Focus_change style */
#focus_change { position:relative; width:450px; height:295px; overflow:hidden; margin:20px 0 1px 60px; }
#focus_change_list { position:absolute; width:3000px; height:295px; }
#focus_change_list li { float:left; }
#focus_change_list li img { width:450px; height:295px; }
.focus_change_opacity { position:absolute; width:450px; height:70px; top:225px; left:0; background:#000; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5; }
#focus_change_btn { position:absolute; width:450px; height:65px; top:225px; left:0; }
#focus_change_btn ul { padding-left:5px; }
#focus_change_btn li { display:inline; float:left; margin:0 15px; padding-top:12px; }
#focus_change_btn li img { width:76px; height:50px; border:2px solid #888; }
#focus_change_btn .current { background:url() no-repeat 37px 8px;}
#focus_change_btn .current img { border-color:#EEE; }
</style>
<script type="text/javascript">
function $(id) { return document.getElementById(id); }
function moveElement(elementID,final_x,final_y,interval) {
if (!document.getElementById) return false;
if (!document.getElementById(elementID)) return false;
var elem = document.getElementById(elementID);
if (elem.movement) {
clearTimeout(elem.movement);
}
if (!elem.style.left) {
elem.style.left = "0px";
}
if (!elem.style.top) {
elem.style.top = "0px";
}
var xpos = parseInt(elem.style.left);
var ypos = parseInt(elem.style.top);
if (xpos == final_x && ypos == final_y) {
return true;
}
if (xpos < final_x) {
var dist = Math.ceil((final_x - xpos)/10);
xpos = xpos + dist;
}
if (xpos > final_x) {
var dist = Math.ceil((xpos - final_x)/10);
xpos = xpos - dist;
}
if (ypos < final_y) {
var dist = Math.ceil((final_y - ypos)/10);
ypos = ypos + dist;
}
if (ypos > final_y) {
var dist = Math.ceil((ypos - final_y)/10);
ypos = ypos - dist;
}
elem.style.left = xpos + "px";
elem.style.top = ypos + "px";
var repeat = "moveElement('"+elementID+"',"+final_x+","+final_y+","+interval+")";
elem.movement = setTimeout(repeat,interval);
}
function classNormal(){
var focusBtnList = $('focus_change_btn').getElementsByTagName('li');
for(var i=0; i<focusBtnList.length; i++) {
focusBtnList[i].className='';
}
}
function focusChange() {
var focusBtnList = $('focus_change_btn').getElementsByTagName('li');
focusBtnList[0].onmouseover = function() {
moveElement('focus_change_list',0,0,5);
classNormal()
focusBtnList[0].className='current'
}
focusBtnList[1].onmouseover = function() {
moveElement('focus_change_list',-450,0,5);
classNormal()
focusBtnList[1].className='current'
}
focusBtnList[2].onmouseover = function() {
moveElement('focus_change_list',-900,0,5);
classNormal()
focusBtnList[2].className='current'
}
focusBtnList[3].onmouseover = function() {
moveElement('focus_change_list',-1350,0,5);
classNormal()
focusBtnList[3].className='current'
}
focusBtnList[4].onmouseover = function() {
moveElement('focus_change_list',-1800,0,5);
classNormal()
focusBtnList[4].className='current'
}
}
setInterval('autoFocusChange()',5000);
function autoFocusChange() {
var focusBtnList = $('focus_change_btn').getElementsByTagName('li');
for(var i=0; i<focusBtnList.length; i++) {
if (focusBtnList[i].className == 'current') {
var currentNum = i;
}
}
if (currentNum==0 ){
moveElement('focus_change_list',-450,0,5);
classNormal()
focusBtnList[1].className='current'
}
if (currentNum==1 ){
moveElement('focus_change_list',-900,0,5);
classNormal()
focusBtnList[2].className='current'
}
if (currentNum==2 ){
moveElement('focus_change_list',-1350,0,5);
classNormal()
focusBtnList[3].className='current'
}
if (currentNum==3 ){
moveElement('focus_change_list',-1800,0,5);
classNormal()
focusBtnList[4].className='current'
}
if (currentNum==4 ){
moveElement('focus_change_list',0,0,5);
classNormal()
focusBtnList[0].className='current'
}
}
window.onload=function(){
focusChange();
}
</script>
</head>
<body>
<div id="focus_change">
<div id="focus_change_list" style="top:0; left:0;">
<ul>
<li><img src="img/1.jpg" alt="" /></li>
<li><img src="img/2.jpg" alt="" /></li>
<li><img src="img/3.jpg" alt="" /></li>
<li><img src="img/4.jpg" alt="" /></li>
<li><img src="img/5.jpg" alt="" /></li>
<li><img src="img/6.jpg" alt="" /></li>
</ul>
</div>
<div class="focus_change_opacity"></div>
<div id="focus_change_btn">
<ul>
<li><a href="#"><img src="img/1.jpg" alt="" /></a></li>
<li><a href="#"><img src="img/2.jpg" alt="" /></a></li>
<li><a href="#"><img src="img/3.jpg" alt="" /></a></li>
<li><a href="#"><img src="img/4.jpg" alt="" /></a></li>
<li><a href="#"><img src="img/5.jpg" alt="" /></a></li>
</ul>
</div>
</div><!--focus_change end-->
</body>
</html>
是不是你要的效果

onmouseover onmouseout 事件

2张图片都是隐藏的...触发事件的时候就显示

  • 19686909380 :求网页图片淡入显示效果代码 ,谢谢!
    益枫莺4931 :答:<TITLE>CSS的blendtransp属性实现图片的淡入淡出效果丨芯晴网页特效丨CsrCode.Cn</TITLE> <SCRIPT> <!-- function fadeOut(obj){ obj.style.filter="blendTrans(duration=2)";if ((obj.visibility != "hidden") && (obj.filters.blendTrans.status != 2)){ obj.filters.blendTrans.Apply();obj....
  • 19686909380 :14款经典网页图片和文字特效的jQuery插件-前端开发必备
    益枫莺4931 :答:不废话了,直接贴图片了,亲们可以点击查看演示和下载源码哦。经典1、网页图片3d旋转jQuery代码查看演示 下载插件经典2、存css3实现的tabl选项卡代码查看演示 下载插件经典3、jQuery标签旋转代码查看演示 下载插件经典4、鼠标悬浮的图片选项卡代码查看演示 下载插件经典5、鼠标往下滚动时文字变大的css3代码查看...
  • 19686909380 :求一个网站前端特效(鼠标经过图片左侧滑动文字说明)
    益枫莺4931 :答:纯CSS代码特效,当鼠标经过图片时,图片弹出说明文字,文字背景半透明,同时图片的边框会变换颜色。 鼠标经过图片,边框变色,图片上出现半透明文字 img{border:none} .wrap{margin:8px;position:relative;} .photo a{position:absolute;display:block;border:1px solid #888888;padding:2px} .photo a:...
  • 19686909380 :网页图片怎么加上这种特效?
    益枫莺4931 :答:获取鼠标所在图片的位置,分左右或者上下,这个自己看着办,然在点击图片的事件里面,根据判断去实现是换到下一个图片还是上一个图片
  • 19686909380 :如何实现网页特效?
    益枫莺4931 :答:1.建立第一个滚动字幕。代码:<marquee width="200" height="100" direction="right" behavior="alternate" scrollamount="6" scrolldelay="88">欢迎光临1</marquee> 2.各参数详解:a)scrollAmount。它表示速度,值越大速度越快。如果没有它,默认为6,建议设为1~3比较好。b)width和height,表示...
  • 19686909380 :如何快速制作网页特效
    益枫莺4931 :答:1.打开你需要的带特效的网站,单击菜单栏(上面)的查看-源文件.然后找到你需要的特效的代码段(用dreamweaver软件容易找些),复制~粘贴~改代码(最好先了解javascript语言~否则比较麻烦)2.先获得你要变换图片的控件(用ById),然后写个方法~在里面写个循环,或者用随机数获得图片并且附给你要变图片的...
  • 19686909380 :急`加急等``网页图片触发特效``黑白变彩```
    益枫莺4931 :答:1、函数说明:doTrans(spanid,imgid,filterCode)spanid:SPAN标签ID。自己起名。imgid:图片的ID。自己起名。filterCode:特效名称。2、HTML格式:每一个图片处都得用如下格式,且有唯一ID。<SPAN id=spanid><IMG id=imgid span></SPAN> 在上面例子中,只需更改并对应上ID就可实现多图应用。用于...
  • 19686909380 :求网页特效,让一个图片固定在网页的左下角
    益枫莺4931 :答:floor(percent);document.all.lovexin0.style.pixelTop+=percent;lastScrollY=lastScrollY+percent;} window.setInterval("heartBeat0()",1); 把这些代码放在之间 第一行最后那个数字 TOP: 400px 这个400px 是就是你图片的顶端和网页的顶端之间的距离可任意修改 ...
  • 19686909380 :如何使用javascript实现网页上相册的3D特效
    益枫莺4931 :答:clearInterval( ctr1);createImg.height += 3;createImg.width += 3;createDiv.style.height = createImg.height;createDiv.style.width = createImg.width;setTimeout( "enlarge()", 30);} } function narrow(){ if ( createImg.height > h && createImg.width > w && isenlarge == 0)...
  • 19686909380 :求一个能够制作网页、建立网站的软件
    益枫莺4931 :答:一个很好用的制作网页动画的软件,它提供了六种特效,10.MagicGallery4.5 一款制作网页照片集以及其缩略图的软件 11.AnimagicGIFAnimator1.22 一个很好用的制作网页动画的软件 12.BannerMakerProV4.0.0.1汉化版 是一套制作网页横幅广告及按钮软件。特点包含:可以调 13.BannerMakerProV6.0.6 是...
  • 相关链接

    欢迎反馈与建议,请联系电邮
    2024 © 视觉网