日期:2014-05-16  浏览次数:20444 次

JS焦点图论坛代码怎么修改
从网上下载了一个焦点图轮换的代码,代码效果如下:http://123.254.109.117/ 这个代码是自动切换图片、鼠标放上去也可以切换,请教前辈,怎样把它改成只有鼠标点击小图以后切换。全部的代码如下:
HTML code

<!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" />

<meta name="keywords" content="JS" />

<meta name="description" content="此代码属于站长常用代码,更多代码请访问懒人图库JS代码频道。" />

<title>懒人图库</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:#0287CA; text-decoration:none; }

    a:hover { text-decoration:underline; }

ul, li { list-style:none; }

fieldset, img { border:none; }

legend { display:none; }

em, strong, cite, th { font-style:normal; font-weight:normal; }

input, textarea, select, button { font:12px Helvetica, Arial, sans-serif; }

table { border-collapse:collapse; }

html { overflow:-moz-scrollbars-vertical; } /*Always show Firefox scrollbar*/



/* iFocus style */

#ifocus { width:525px; height:245px; margin:20px; border:1px solid #DEDEDE; background:#F8F8F8; }

    #ifocus_pic { display:inline; position:relative; float:left; width:410px; height:225px; overflow:hidden; margin:10px 0 0 10px; }

        #ifocus_piclist { position:absolute; }

        #ifocus_piclist li { width:410px; height:225px; overflow:hidden; }

        #ifocus_piclist img { width:410px; height:225px; }

    #ifocus_btn { display:inline; float:right; width:91px; margin:9px 9px 0 0; }

        #ifocus_btn li { width:91px; height:57px; cursor:pointer; opacity:0.5; -moz-opacity:0.5; filter:alpha(opacity=50); }

        #ifocus_btn img { width:75px; height:45px; margin:7px 0 0 11px; }

        #ifocus_btn .current { background: url(images/ifocus_btn_bg.gif) no-repeat; opacity:1; -moz-opacity:1; filter:alpha(opacity=100); }

    #ifocus_opdiv { position:absolute; left:0; bottom:0; width:410px; height:35px; background:#000; opacity:0.5; -moz-opacity:0.5; filter:alpha(opacity=50); }

    #ifocus_tx { position:absolute; left:8px; bottom:8px; color:#FFF; }

        #ifocus_tx .normal { display:none; }

</style>



<script type="text/javascript">

function $(id) { return document.getElementById(id); }



function addLoadEvent(func){

    var oldonload = window.onload;

    if (typeof window.onload != 'function') {

        window.onload = func;

    } else {

        window.onload = function(){

            oldonload();

            func();

        }

    }

}



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.st