图片自动切换——javascript的代码
来源:互联网 发布:bugku sql注入1 编辑:程序博客网 时间:2024/05/17 06:39
<textarea cols="50" rows="15" name="code" class="javascript"><!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>热销产品</title><mce:style type="text/css"><!--/* Reset style */* { margin:0; padding:0; word-break:break-all; }body { background:#CCCCCC; color:#CCCCCC; 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:10px 0 1px 10px; } #focus_change_list { position:absolute; width:1800px; 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(img/hotgoods.jpg) no-repeat 37px 8px;} #focus_change_btn .current img { border-color:#EEE; }--></mce:style><style type="text/css" mce_bogus="1">/* Reset style */* { margin:0; padding:0; word-break:break-all; }body { background:#CCCCCC; color:#CCCCCC; 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:10px 0 1px 10px; } #focus_change_list { position:absolute; width:1800px; 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(img/hotgoods.jpg) no-repeat 37px 8px;} #focus_change_btn .current img { border-color:#EEE; }</style><mce: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' }}setInterval('autoFocusChange()', 5000);var atuokey = false;function autoFocusChange() { $('focus_change').onmouseover = function(){atuokey = true} $('focus_change').onmouseout = function(){atuokey = false} if(atuokey) return; 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',0,0,5); classNormal() focusBtnList[0].className='current' }}window.onload=function(){ focusChange();}// --></mce:script></head><body bgcolor="#cccccc" topmargin="0"><div id="focus_change" style="background-color:#CCCCCC" mce_style="background-color:#CCCCCC"><div id="focus_change_list" style="top:0; left:0;color:#CCCCCC"><ul><li><img src="img/hotgoods01.jpg" mce_src="img/hotgoods01.jpg" alt="" /></li><li><img src="img/hotgoods02.jpg" mce_src="img/hotgoods02.jpg" alt="" /></li><li><img src="img/hotgoods03.jpg" mce_src="img/hotgoods03.jpg" alt="" /></li><li><img src="img/hotgoods04.jpg" mce_src="img/hotgoods04.jpg" alt="" /></li></ul></div><div class="focus_change_opacity"></div><div id="focus_change_btn"><ul><li class="current"><a href="#" mce_href="#"><img src="img/hotgoods01.jpg" mce_src="img/hotgoods01.jpg" alt="" /></a></li><li><a href="#" mce_href="#"><img src="img/hotgoods02.jpg" mce_src="img/hotgoods02.jpg" width="78" alt="" /></a></li><li><a href="#" mce_href="#"><img src="img/hotgoods03.jpg" mce_src="img/hotgoods03.jpg" width="78" alt="" /></a></li><li><a href="#" mce_href="#"><img src="img/hotgoods04.jpg" mce_src="img/hotgoods04.jpg" width="78" alt="" /></a></li></ul></div></div><!--focus_change end--></body></html></textarea>
over
- 图片自动切换——javascript的代码
- 蜗牛—JavaScript学习之图片自动切换
- FLASH图片自动切换代码
- [javascript]首页图片自动切换的一种实现方式
- [javascript]首页图片自动切换的一种实现方式
- JavaScript实现Mop自动切换的图片新闻框子
- 一段非常简单的让图片自动切换js代码
- 一段非常简单的让图片自动切换js代码
- 一串JS代码实现图片的自动切换
- 一段非常简单的让图片自动切换js代码
- JavaScript实现图片的滑动切换效果 的Js代码
- JavaScript实现图片的滑动切换效果 的Js代码
- 原生javascript图片自动切换功能
- javascript图片自动左右滑动滚动切换
- 定时器 — 图片自动切换(轮播图)
- JavaScript 图片自动缩放代码!
- javascript图片自动播放代码
- 图片自动切换并改变链接代码
- 实习结束了~
- 找工作难啊。。。
- Qt Window编程—— 快速创建界面
- 刘一男
- php学习
- 图片自动切换——javascript的代码
- WinForm项目打包(转载)
- 简要分析Ogre渲染队列的实现原理(一)
- vim配置
- 用SendARP API函数获取远程主机MAC地址学习心得
- HDU 1305 Immediate Decodability(二叉树)
- 对于Socket的UDP数据广播的重新认识
- XML 节点解析函数MySelf 学习
- Hello world!