五常信息网(五常论坛)

 找回密码
 立即注册
搜索
查看: 1510|回复: 6
打印 上一主题 下一主题

精美图片展示效果代码

[复制链接]

1763

主题

1万

帖子

46万

积分

系统管理员

Rank: 10Rank: 10Rank: 10

积分
462646
金钱
157396
威望
182736
经验值
99357
魅力
2079
精华
13
QQ
跳转到指定楼层
楼主
发表于 2009-9-23 09:36:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

<!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=gb2312" />
<title>超酷超绚精美图片展示效果代码(一) - 网页特效观止-网页特效代码|JsCode.CN|</title>
<meta http-equiv="imagetoolbar" content="no">
<style type="text/css">
 html {
  overflow: hidden;
 }
 body {
  margin: 0px;
  padding: 0px;
  background: #000;
  width: 100%;
  height: 100%;
 }
 #imageFlow {
  position: absolute;
  width: 100%;
  height: 80%;
  left: 0%;
  top: 10%;
  background: #000;
 }
 #imageFlow .diapo {
  position: absolute;
  left: -1000px;
  cursor: pointer;
  -ms-interpolation-mode: nearest-neighbor;
 }
 #imageFlow .link {
  border: dotted #fff 1px;
  margin-left: -1px;
  margin-bottom: -1px;
 }
 #imageFlow .bank {
  visibility: hidden;
 }
 #imageFlow .top {
  position: absolute;
  width: 100%;
  height: 40%;
  background: #181818;
 }
 #imageFlow .text {
  position: absolute;
  left: 0px;
  width: 100%;
  bottom: 16%;
  text-align: center;
  color: #FFF;
  font-family: verdana, arial, Helvetica, sans-serif;
  z-index: 1000;
 }
 #imageFlow .title {
  font-size: 0.9em;
  font-weight: bold;
 }
 #imageFlow .legend {
  font-size: 0.8em;
 }
 #imageFlow .scrollbar {
  position: absolute;
  left: 10%;
  bottom: 10%;
  width: 80%;
  height: 16px;
  z-index: 1000;
 }
 #imageFlow .track {
  position: absolute;
  left: 1%;
  width: 98%;
  height: 16px;
  filter: alpha(opacity=30);
  opacity: 0.3;
 }
 #imageFlow .arrow-left {
  position: absolute;
 }
 #imageFlow .arrow-right {
  position: absolute;
  right: 0px;
 }
 #imageFlow .bar {
  position: absolute;
  height: 16px;
  left: 25px;
 }
</style>
<script type="text/javascript">

var imf = function () {
 var lf = 0;
 var instances = [];
 function getElementsByClass (object, tag, className) {
  var o = object.getElementsByTagName(tag);
  for ( var i = 0, n = o.length, ret = []; i < n; i++)
   if (o.className == className) ret.push(o);
  if (ret.length == 1) ret = ret[0];
  return ret;
 }
 function addEvent (o, e, f) {
  if (window.addEventListener) o.addEventListener(e, f, false);
  else if (window.attachEvent) r = o.attachEvent('on' + e, f);
 }
 function createReflexion (cont, img) {
  var flx = false;
  if (document.createElement("canvas").getContext) {
   flx = document.createElement("canvas");
   flx.width = img.width;
   flx.height = img.height;
   var context = flx.getContext("2d");
   context.translate(0, img.height);
   context.scale(1, -1);
   context.drawImage(img, 0, 0, img.width, img.height);
   context.globalCompositeOperation = "destination-out";
   var gradient = context.createLinearGradient(0, 0, 0, img.height * 2);
   gradient.addColorStop(1, "rgba(255, 255, 255, 0)");
   gradient.addColorStop(0, "rgba(255, 255, 255, 1)");
   context.fillStyle = gradient;
   context.fillRect(0, 0, img.width, img.height * 2);
  } else {
   /* ---- DXImageTransform ---- */
   flx     = document.createElement('img');
   flx.src = img.src;
   flx.style.filter = 'flipv progid:DXImageTransform.Microsoft.Alpha(' +
                      'opacity=50, style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=' +
          (img.height * .25) + ')';
  }
  /* ---- insert Reflexion ---- */
  flx.style.position = 'absolute';
  flx.style.left     = '-1000px';
  cont.appendChild(flx);
  return flx;
 }
 /* //////////// ==== ImageFlow Constructor ==== //////////// */
 function ImageFlow(oCont, size, zoom, border) {
  this.diapos     = [];
  this.scr        = false;
  this.size       = size;
  this.zoom       = zoom;
  this.bdw        = border;
  this.oCont      = oCont;
  this.oc         = document.getElementById(oCont);
  this.scrollbar  = getElementsByClass(this.oc,   'div', 'scrollbar');
  this.text       = getElementsByClass(this.oc,   'div', 'text');
  this.title      = getElementsByClass(this.text, 'div', 'title');
  this.legend     = getElementsByClass(this.text, 'div', 'legend');
  this.bar        = getElementsByClass(this.oc,   'img', 'bar');
  this.arL        = getElementsByClass(this.oc,   'img', 'arrow-left');
  this.arR        = getElementsByClass(this.oc,   'img', 'arrow-right');
  this.bw         = this.bar.width;
  this.alw        = this.arL.width - 5;
  this.arw        = this.arR.width - 5;
  this.bar.parent = this.oc.parent  = this;
  this.arL.parent = this.arR.parent = this;
  this.view       = this.back       = -1;
  this.resize();
  this.oc.onselectstart = function () { return false; }
  /* ---- create images ---- */
  var img   = getElementsByClass(this.oc, 'div', 'bank').getElementsByTagName('a');
  this.NF = img.length;
  for (var i = 0, o; o = img; i++) {
   this.diapos = new Diapo(this, i,
          o.rel,
          o.title || '- ' + i + ' -',
          o.innerHTML || o.rel,
          o.href || '',
          o.target || '_self'
   );
  }
  /* ==== add mouse wheel events ==== */
  if (window.addEventListener)
   this.oc.addEventListener('DOMMouseScroll', function(e) {
    this.parent.scroll(-e.detail);
   }, false);
  else this.oc.onmousewheel = function () {
   this.parent.scroll(event.wheelDelta);
  }
  /* ==== scrollbar drag N drop ==== */
  this.bar.onmousedown = function (e) {
   if (!e) e = window.event;
   var scl = e.screenX - this.offsetLeft;
   var self = this.parent;
   /* ---- move bar ---- */
   this.parent.oc.onmousemove = function (e) {
    if (!e) e = window.event;
    self.bar.style.left = Math.round(Math.min((self.ws - self.arw - self.bw), Math.max(self.alw, e.screenX - scl))) + 'px';
    self.view = Math.round(((e.screenX - scl) ) / (self.ws - self.alw - self.arw - self.bw) * self.NF);
    if (self.view != self.back) self.calc();
    return false;
   }
   /* ---- release scrollbar ---- */
   this.parent.oc.onmouseup = function (e) {
    self.oc.onmousemove = null;
    return false;
   }
   return false;
  }
  /* ==== right arrow ==== */
  this.arR.onclick = this.arR.ondblclick = function () {
   if (this.parent.view < this.parent.NF - 1)
    this.parent.calc(1);
  }
  /* ==== Left arrow ==== */
  this.arL.onclick = this.arL.ondblclick = function () {
   if (this.parent.view > 0)
    this.parent.calc(-1);
  }
 }
 /* //////////// ==== ImageFlow prototype ==== //////////// */
 ImageFlow.prototype = {
  /* ==== targets ==== */
  calc : function (inc) {
   if (inc) this.view += inc;
   var tw = 0;
   var lw = 0;
   var o = this.diapos[this.view];
   if (o && o.loaded) {
    /* ---- reset ---- */
    var ob = this.diapos[this.back];
    if (ob && ob != o) {
     ob.img.className = 'diapo';
     ob.z1 = 1;
    }
    /* ---- update legend ---- */
    this.title.replaceChild(document.createTextNode(o.title), this.title.firstChild);
    this.legend.replaceChild(document.createTextNode(o.text), this.legend.firstChild);
    /* ---- update hyperlink ---- */
    if (o.url) {
     o.img.className = 'diapo link';
     window.status = 'hyperlink: ' + o.url;
    } else {
     o.img.className = 'diapo';
     window.status = '';
    }
    /* ---- calculate target sizes & positions ---- */
    o.w1 = Math.min(o.iw, this.wh * .5) * o.z1;
    var x0 = o.x1 = (this.wh * .5) - (o.w1 * .5);
    var x = x0 + o.w1 + this.bdw;
    for (var i = this.view + 1, o; o = this.diapos; i++) {
     if (o.loaded) {
      o.x1 = x;
      o.w1 = (this.ht / o.r) * this.size;
      x   += o.w1 + this.bdw;
      tw  += o.w1 + this.bdw;
     }
    }
    x = x0 - this.bdw;
    for (var i = this.view - 1, o; o = this.diapos; i--) {
     if (o.loaded) {
      o.w1 = (this.ht / o.r) * this.size;
      o.x1 = x - o.w1;
      x   -= o.w1 + this.bdw;
      tw  += o.w1 + this.bdw;
      lw  += o.w1 + this.bdw;
     }
    }
    /* ---- move scrollbar ---- */
    if (!this.scr && tw) {
     var r = (this.ws - this.alw - this.arw - this.bw) / tw;
     this.bar.style.left = Math.round(this.alw + lw * r) + 'px';
    }
    /* ---- save preview view ---- */
    this.back = this.view;
   }
  },
  /* ==== mousewheel scrolling ==== */
  scroll : function (sc) {
   if (sc < 0) {
    if (this.view < this.NF - 1) this.calc(1);
   } else {
    if (this.view > 0) this.calc(-1);
   }
  },
  /* ==== resize  ==== */
  resize : function () {
   this.wh = this.oc.clientWidth;
   this.ht = this.oc.clientHeight;
   this.ws = this.scrollbar.offsetWidth;
   this.calc();
   this.run(true);
  },
  /* ==== move all images  ==== */
  run : function (res) {
   var i = this.NF;
   while (i--) this.diapos.move(res);
  }
 }
 /* //////////// ==== Diapo Constructor ==== //////////// */
 Diapo = function (parent, N, src, title, text, url, target) {
  this.parent        = parent;
  this.loaded        = false;
  this.title         = title;
  this.text          = text;
  this.url           = url;
  this.target        = target;
  this.N             = N;
  this.img           = document.createElement('img');
  this.img.src       = src;
  this.img.parent    = this;
  this.img.className = 'diapo';
  this.x0            = this.parent.oc.clientWidth;
  this.x1            = this.x0;
  this.w0            = 0;
  this.w1            = 0;
  this.z1            = 1;
  this.img.parent    = this;
  this.img.onclick   = function() { this.parent.click(); }
  this.parent.oc.appendChild(this.img);
  /* ---- display external link ---- */
  if (url) {
   this.img.onmouseover = function () { this.className = 'diapo link'; }
   this.img.onmouseout  = function () { this.className = 'diapo'; }
  }
 }
 /* //////////// ==== Diapo prototype ==== //////////// */
 Diapo.prototype = {
  /* ==== HTML rendering ==== */
  move : function (res) {
   if (this.loaded) {
    var sx = this.x1 - this.x0;
    var sw = this.w1 - this.w0;
    if (Math.abs(sx) > 2 || Math.abs(sw) > 2 || res) {
     /* ---- paint only when moving ---- */
     this.x0 += sx * .1;
     this.w0 += sw * .1;
     if (this.x0 < this.parent.wh && this.x0 + this.w0 > 0) {
      /* ---- paint only visible images ---- */
      this.visible = true;
      var o = this.img.style;
      var h = this.w0 * this.r;
      /* ---- diapo ---- */
      o.left   = Math.round(this.x0) + 'px';
      o.bottom = Math.floor(this.parent.ht * .25) + 'px';
      o.width  = Math.round(this.w0) + 'px';
      o.height = Math.round(h) + 'px';
      /* ---- reflexion ---- */
      if (this.flx) {
       var o = this.flx.style;
       o.left   = Math.round(this.x0) + 'px';
       o.top    = Math.ceil(this.parent.ht * .75 + 1) + 'px';
       o.width  = Math.round(this.w0) + 'px';
       o.height = Math.round(h) + 'px';
      }
     } else {
      /* ---- disable invisible images ---- */
      if (this.visible) {
       this.visible = false;
       this.img.style.width = '0px';
       if (this.flx) this.flx.style.width = '0px';
      }
     }
    }
   } else {
    /* ==== image onload ==== */
    if (this.img.complete && this.img.width) {
     /* ---- get size image ---- */
     this.iw     = this.img.width;
     this.ih     = this.img.height;
     this.r      = this.ih / this.iw;
     this.loaded = true;
     /* ---- create reflexion ---- */
     this.flx    = createReflexion(this.parent.oc, this.img);
     if (this.parent.view < 0) this.parent.view = this.N;
     this.parent.calc();
    }
   }
  },
  /* ==== diapo onclick ==== */
  click : function () {
   if (this.parent.view == this.N) {
    /* ---- click on zoomed diapo ---- */
    if (this.url) {
     /* ---- open hyperlink ---- */
     window.open(this.url, this.target);
    } else {
     /* ---- zoom in/out ---- */
     this.z1 = this.z1 == 1 ? this.parent.zoom : 1;
     this.parent.calc();
    }
   } else {
    /* ---- select diapo ---- */
    this.parent.view = this.N;
    this.parent.calc();
   }
   return false;
  }
 }
 /* //////////// ==== public methods ==== //////////// */
 return {
  /* ==== initialize script ==== */
  create : function (div, size, zoom, border) {
   /* ---- instanciate imageFlow ---- */
   var load = function () {
    var loaded = false;
    var i = instances.length;
    while (i--) if (instances.oCont == div) loaded = true;
    if (!loaded) {
     /* ---- push new imageFlow instance ---- */
     instances.push(
      new ImageFlow(div, size, zoom, border)
     );
     /* ---- init script (once) ---- */
     if (!imf.initialized) {
      imf.initialized = true;
      /* ---- window resize event ---- */
      addEvent(window, 'resize', function () {
       var i = instances.length;
       while (i--) instances.resize();
      });
      /* ---- stop drag N drop ---- */
      addEvent(document.getElementById(div), 'mouseout', function (e) {
       if (!e) e = window.event;
       var tg = e.relatedTarget || e.toElement;
       if (tg && tg.tagName == 'HTML') {
        var i = instances.length;
        while (i--) instances.oc.onmousemove = null;
       }
       return false;
      });
      /* ---- set interval loop ---- */
      setInterval(function () {
       var i = instances.length;
       while (i--) instances.run();
      }, 16);
     }
    }
   }
   /* ---- window onload event ---- */
   addEvent(window, 'load', function () { load(); });
  }
 }
}();

/* ==== create imageFlow ==== */
//          div ID    , size, zoom, border
imf.create("imageFlow", 0.15, 1.5, 10);

</script>
</head>

<body>

<div id="imageFlow">
 <div class="top">
 </div>
 <div class="bank">
  <a rel="images/08081201001.jpg" title="Myselves" href="http://www.jscode.cn/">
  My identity lies in not knowing who I am</a>
  <a rel="images/08081201002.jpg" title="Discoveries" href="http://www.jscode.cn/">
  ...are made by not following instructions</a>
  <a rel="images/08081201003.jpg" title="Nothing" href="http://jscode.cn/">
  ...can come between us</a>
  <a rel="images/08081201004.jpg" title="New life" href="http://www.jscode.cn/">
  Here you come!</a>
  <a rel="images/08081201005.jpg" title="Optimists" href="http://www.html.org.cn/">
  They don&#39;t know all the facts yet</a>
  <a rel="images/08081201006.jpg" title="Empathy" href="http://www.jscode.cn/">
  Emotional intimacy</a>
  <a rel="images/08081201007.jpg" title="Much work" href="http://www.jscode.cn/">
  ...remains to be done before we can announce our total failure to make any
  progress</a>
  <a rel="images/08081201008.jpg" title="System error" href="http://www.jscode.cn/">
  Errare Programma Est</a>
  <a rel="images/08081201009.jpg" title="Nonexistance" href="http://bbs.html.org.cn/">
  There&#39;s no such thing</a>
  <a rel="images/08081201010.jpg" title="Inside" href="http://www.jscode.cn/">
  I抦 now trapped, without hope of escape or rescue</a>
  <a rel="images/08081201011.jpg" title="E-Slaves" href="http://www.luwei.net.cn/">
  The World is flat</a>
  <a rel="images/08081201012.jpg" title="l0v3" href="http://www.jscode.cn/">
  1 l0v3 j00 - f0r3v3r</a>
  <a rel="images/08081201013.jpg" title="T minus zero" href="http://www.jscode.cn/">
  111 111 111 x 111 111 111 = 12345678987654321</a>
  <a rel="images/08081201014.jpg" title="The End" href="http://www.jscode.cn/">
  ...has not been written yet</a> </div>
 <div class="text">
  <div class="title">
   Loading</div>
  <div class="legend">
   Please wait...</div>
 </div>
 <div class="scrollbar">
  <img class="track" src="images/08081201sb.gif" alt="">
  <img class="arrow-left" src="images/08081201sl.gif" alt="">
  <img class="arrow-right" src="images/08081201sr.gif" alt="">
  <img class="bar" src="images/08081201sc.gif" alt=""> </div>
</div>

</body>

</html>

五常论坛是您快乐的网上家园,是您温馨的休闲港湾!

1763

主题

1万

帖子

46万

积分

系统管理员

Rank: 10Rank: 10Rank: 10

积分
462646
金钱
157396
威望
182736
经验值
99357
魅力
2079
精华
13
QQ
沙发
 楼主| 发表于 2009-9-23 09:37:25 | 只看该作者

<!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=gb2312" />
<title>超酷超绚精美图片展示效果代码(五) - 网页特效观止-网页特效代码|JsCode.CN|</title>
<meta http-equiv="imagetoolbar" content="no">
<style type="text/css">
 html {
  overflow: hidden;
 }
 body {
  margin: 0px;
  padding: 0px;
  background: #000;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: crosshair;
 }
 #box {
  position: absolute;
  background: #111;
  border: gray solid 1px;
  visibility: hidden;
 }
 #screen {
  position: absolute;
  left: 0px;
  width: 100%;
  top: 10%;
  height: 80%;
  background: #000;
  border: gray solid 1px;
 }
 #box img  {
  position: absolute;
  border: gray solid 1px;
  cursor: pointer;
 }
 #box span {
  position: absolute;
  color: #ccc;
  font-family: verdana;
  font-size: 12px;
  width: 200px;
 }
 #box a {
  text-decoration: none;
  color:#ff8000;
 }
 #box a:hover {
  text-decoration: none;
  background:#ff8000;
  color:#ffffff;
 }
 #box a:visited {
  text-decoration: none;
  color:#ff8000;
 }
 #box a:visited:hover {
  text-decoration: none;
  background:#ff8000;
  color:#ffffff;
 }
 #lnk {
  visibility: hidden;
 }
</style>
<script type="text/javascript">

document.onselectstart = new Function("return false");
O    = new Array();
box  = 0;
img  = 0;
txt  = 0;
tit  = 0;
W    = 0;
H    = 0;
nI   = 0;
sel  = 0;
si   = 0;
ZOOM = 0;
rImg = 0;
//////////////////
speed = .06; // animation speed
delay = .5; // 1 = no delay
//////////////////

function dText(){
 txt.style.textAlign = tit.style.textAlign = (sel<nI/2)?"left":"right";
 txt.innerHTML = O[sel].tx;
 tit.innerHTML = O[sel].ti;
}

function CObj(n, s, x, tx, ti){
 this.n    = n;
 this.dim  = s;
 this.tx   = tx;
 this.ti   = ti;
 this.is   = img[n];
 this.vz   = 0;
 this.sx   = 0;
 this.x0   = x;
 this.x1   = 0;
 this.zo   = 0;
 this.over = function() {
  with(this){
   if(n!=sel){
    O[sel].dim = 100;
    O[n].dim = ZOOM * 100;
    sel = n;
    l = 0;
    for(k=0; k<nI; k++){
     O[k].x0 = l;
     l += O[k].dim;
    }
    txt.innerHTML = tit.innerHTML = "";
    setTimeout("dText()", 32);
   }
  }
 }
 this.anim = function () {
  with(this){
   vz  = speed*(vz+(x1-sx)*delay);
   x1 -= vz;
   sx  = (n==0)?0:O[n-1].x0+O[n-1].dim;
   zo -= (zo-dim)*speed;
   l   = (x1*si)+6*(n+1);
   w   = zo*si;
   is.style.left   = Math.round(l)+'px';
   is.style.top    = Math.round((H-w*rImg)*.5)+'px';
   is.style.width  = Math.round(w)+'px';
   is.style.height = Math.round(w*rImg)+'px';
   if(sel == n){
    if(sel<nI*.5) {
     tit.style.left = txt.style.left = Math.round(l+w+6)+'px';
    } else {
     tit.style.left = txt.style.left = Math.round(l-(nx*.25)-6)+'px';
    }
    txt.style.top = Math.round(-(w*rImg)*.25)+'px';
    tit.style.top = Math.round((w*rImg)*.33)+'px';
   }
  }
 }
}

function run(){
 for(j in O)O[j].anim();
 setTimeout("run()", 16);
}

function doResize(){
 tit.style.width = Math.round(nx*.25)+'px';
 txt.style.width = Math.round(nx*.25)+'px';
 tit.style.fontSize = (nx/30)+'px';
 txt.style.fontSize = (nx/70)+'px';
 with(box.style){
  width  = Math.round(W)+'px';
  height = Math.round(H)+'px';
  left   = Math.round(nx/2-W/2)+'px';
  top    = Math.round(ny/2-H/2)+'px';
 }
}

function resize(){
 nx = scr.offsetWidth;
 ny = scr.offsetHeight;
 W  =  nx*90/100;
 si = (W-((nI+1)*6))/((ZOOM*100)+((nI-1)*100));
 H  = (100*si*rImg)+14;
 doResize();
}
onresize = resize;

onload = function(){
 scr = document.getElementById("screen");
 box = document.getElementById("box");
 tit = document.getElementById("tit");
 txt = document.getElementById("txt");
 img = box.getElementsByTagName("img");

 Lnk = document.getElementById("lnk").getElementsByTagName("a");
 nI  = img.length;
 ZOOM = nI;
 rImg = img[0].height/img[0].width;
 resize();
 s = ZOOM * 100;
 x = 0;
 tit.innerHTML = img[0].title;
 txt.innerHTML = img[0].alt;
 for(i=0; i<nI; i++) {
  var t = img.alt;
  if(Lnk.href!="") t+='<br><a href="'+Lnk.href+'">'+Lnk.innerHTML+'</a>';
  O = new CObj(i, s, x, t, img.title);
  img.alt = "";
  img.title = "";
  img.onmousedown = new Function("return false;");
  img.onmouseover = new Function('O['+i+'].over();');
  if(Lnk.href!=""){
   /* ==== hyperlink ==== */
   img.onclick = new Function('window.open("'+Lnk.href+'","_blank");');
  }
  x += s;
  s = 100;
 }
 box.style.visibility = "visible";
 run();
}
</script>
</head>

<body>

<div id="screen">
 <div id="box">
  <img src="images/08081201001.jpg" title="explain" alt="They explained a little about what they were doing.">
  <img src="images/08081201002.jpg" title="strain" alt="I hoped I wouldn′t crack under the strain.">
  <img src="images/08081201003.jpg" title="retain" alt="Clearly they were ready to do almost anything to retain their position.">
  <img src="images/08081201004.jpg" title="mundane" alt="I observed the face of power at its most mundane.">
  <img src="images/08081201005.jpg" title="inhumane" alt="But they couldn′t hide the very worst of their inhumane undertakings from the people.">
  <img src="images/08081201006.jpg" title="disdain" alt="They showed their utter, complete disdain for justice.">
  <img src="images/08081201008.jpg" title="never again" alt="Never more. Never again.">
  <span id="txt"></span><span id="tit"></span><span id="lnk">
  <a href="http://www.dhteumeuleu.com">www.dhteumeuleu.com</a> <a></a><a>
  </a><a></a><a></a><a></a><a></a></span></div>
</div>
<!-- crossbrowser images_loading_bar - Gerard Ferrandez - www.dhteumeuleu.com - Feb 2005 -->
<span id="LB0" style="position:absolute;left:50%;top:50%;">
<span style="position:absolute;font-family:arial;font-size:10px;color:#FFFFFF;left:-50px;top:-18px">
Loading...</span>
<span style="position:absolute;left:-50px;top:-5px;font-size:1px;width:100px;height:10px;background:#333">
<span id="LB1" style="position:absolute;left:0px;top:0px;font-size:1px;width:0px;height:10px;background:#FFFFFF">
</span></span></span>
<script>m00=document.getElementById("box").getElementsByTagName("img");m01=m00.length;function images_loading_bar(){m02=0;for(i=0;i<m01;i++)m02+=(m00.complete)?1:0;document.getElementById("LB1").style.width=Math.round(m02/m01*100)+'px';if(m02==m01)setTimeout("document.getElementById('LB0').style.display='none'",128); else setTimeout("images_loading_bar()", 64);};images_loading_bar();</script>
<!-- end of images_loading_bar code -->

</body>

</html>

五常论坛是您快乐的网上家园,是您温馨的休闲港湾!
回复 支持 反对

使用道具 举报

1763

主题

1万

帖子

46万

积分

系统管理员

Rank: 10Rank: 10Rank: 10

积分
462646
金钱
157396
威望
182736
经验值
99357
魅力
2079
精华
13
QQ
板凳
 楼主| 发表于 2009-9-23 09:40:13 | 只看该作者

<!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=gb2312" />
<title>超酷超绚精美图片展示效果代码(十) - 网页特效观止-网页特效代码|JsCode.CN|</title>
<meta http-equiv="imagetoolbar" content="no">
<style type="text/css">
 body {
  background: #222;
  overflow: hidden;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
 }
 #screen span {
  position:absolute;
  overflow:hidden;
  border:#FFF solid 1px;
  background:#FFF;
 }
 #screen img{
  position:absolute;
  left:-32px;
  top:-32px;
  cursor: pointer;
 }
 #caption, #title{
  color: #FFF;
  font-family: georgia, 'times new roman', times, veronica, serif;
  font-size: 1em;
  text-align: center;
 }
 #caption b {
  font-size: 2em;
 }

</style>
<script type="text/javascript"><!--
window.onerror = new Function("return true");
var obj = [];
var scr;
var spa;
var img;
var W;
var Wi;
var Hi;
var wi;
var hi;
var Sx;
var Sy;
var M;
var xm;
var ym;
var xb = 0;
var yb = 0;
var ob =  - 1;
var cl = false;

/* needed in standard mode */
px = function(x)
{
 return Math.round(x) + "px";
}

/* center image  - do not resize for perf. reason */
img_center = function(o)
{
 with(img[o])
 {
  style.left = px( - (width - Wi) / 2);
  style.top = px( - (height - Hi) / 2);
 }
}

//////////////////////////////////////////////////////////
var Nx = 4; //size grid x
var Ny = 4; //size grid y
var Tx = 3; // image width
var Ty = 3; // image height
var Mg = 40; // margin
var SP = 1; // speed
//////////////////////////////////////////////////////////

function Cobj(o, x, y)
{
 this.o = o;
 this.ix = Math.min(Nx - Tx, Math.max(0, Math.round(x - (Tx / 2))));
 this.iy = Math.min(Ny - Ty, Math.max(0, Math.round(y - (Ty / 2))));
 this.li = ((this.ix * M + this.ix * Sx) - (x * M + x * Sx)) / SP;
 this.ti = ((this.iy * M + this.iy * Sy) - (y * M + y * Sy)) / SP;
 this.l = 0;
 this.t = 0;
 this.w = 0;
 this.h = 0;
 this.s = 0;
 this.mv = false;
 this.spa = spa[o].style;
 this.img = img[o];
 this.txt = img[o].alt;
 img[o].alt = "";

 /* zooming loop */
 this.zoom = function()
 {
  with(this)
  {
   l += li * s;
   t += ti * s;
   w += wi * s;
   h += hi * s;
   if ((s > 0 && w < Wi) || (s < 0 && w > Sx))
   {
    /* force window.event */
    window.focus();
    /* loop */
    setTimeout("obj[" + o + "].zoom()", 16);
   }
   else
   {
    /* finished */
    mv = false;
    /* set final position */
    if (s > 0)
    {
     l = ix * M + ix * Sx;
     t = iy * M + iy * Sy;
     w = Wi;
     h = Hi;
    }
    else
    {
     l = x * M + x * Sx;
     t = y * M + y * Sy;
     w = Sx;
     h = Sy;
    }
   }
   /* html animation */
   with(spa)
   {
    left = px(l);
    top = px(t);
    width = px(w);
    height = px(h);
    zIndex = Math.round(w);
   }
  }
 }

 this.click = function()
 {
  with(this)
  {
   img_center(o);
   /* zooming logic */
   if ( ! mv || cl)
   {
    if (s > 0)
    {
     if (cl || Math.abs(xm - xb) > Sx * .4 || Math.abs(ym - yb) > Sy * .4)
     {
      s =  - 2;
      mv = true;
      zoom();
      cap.innerHTML = txt;
     }
    }
    else
    {
     if (cl || ob != o)
     {
      if (ob >= 0)
      {
       with(obj[ob])
       {
        s =  - 2;
        mv = true;
        zoom();
       }
      }
      ob = o;
      s = 1;
      xb = xm;
      yb = ym;
      mv = true;
      zoom();
      cap.innerHTML = txt;
     }
    }
   }
  }
 }
 
 /* hook up events */
 img[o].onmouseover = img[o].onmousemove = img[o].onmouseout = new Function("cl=false;obj[" + o + "].click()");
 img[o].onclick = new Function("cl=true;obj[" + o + "].click()");
 img[o].onload = new Function("img_center(" + o + ")");

 /* initial display */
 this.zoom();
}

/* mouse */
document.onmousemove = function(e)
{
 if ( ! e)
 {
  e = window.event;
 }
 xm = (e.x || e.clientX);
 ym = (e.y || e.clientY);
}

/* init */
function load()
{
 /* html elements */
 scr = document.getElementById("screen");
 spa = scr.getElementsByTagName("span");
 img = scr.getElementsByTagName("img");
 cap = document.getElementById("caption");
 
 /* mouseover border */
 document.getElementById("border").onmouseover = function()
 {
  cl = true;
  if(ob >= 0 && obj[ob].s > 0) obj[ob].click();
  ob = -1;
 }

 /* global variables */
 W = parseInt(scr.style.width);
 H = parseInt(scr.style.height);
 M = W / Mg;
 Sx = (W - (Nx - 1) * M) / Nx;
 Sy = (H - (Ny - 1) * M) / Ny;
 Wi = Tx * Sx + (Tx - 1) * M;
 Hi = Ty * Sy + (Ty - 1) * M;
 SP = M * Tx * SP;
 wi = (Wi - Sx) / SP;
 hi = (Hi - Sy) / SP;
 
 /* create objects */
 for (k = 0, i = 0; i < Nx; i ++)
 {
  for (j = 0; j < Ny; j ++)
  {
   obj[k] = new Cobj(k ++, i, j);
  }
 }
}
//-->
</script>
</head>

<body>

<div style="position: absolute; left: 50%; top: 50%;">
 <div id="title" style="position: absolute; width: 440px; height: 40px; left: -220px; top: -200px;">
 </div>
 <div id="border" style="border: 1px solid rgb(85, 85, 85); background: rgb(0, 0, 0) none repeat scroll 0%; position: absolute; width: 440px; height: 340px; left: -220px; top: -170px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
 </div>
 <div id="screen" style="background: rgb(0, 0, 0) none repeat scroll 0%; position: absolute; width: 400px; height: 300px; left: -200px; top: -150px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
  <span style="left: 0px; top: 0px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201001.jpg" alt=""></span>
  <span style="left: 0px; top: 78px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -8px;" src="images/08081201002.jpg" alt=""></span>
  <span style="left: 0px; top: 155px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201003.jpg" alt=""></span>
  <span style="left: 0px; top: 233px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201004.jpg" alt=""></span>
  <span style="left: 103px; top: 0px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201005.jpg" alt=""></span>
  <span style="left: 103px; top: 78px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201006.jpg" alt=""></span>
  <span style="left: 103px; top: 155px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201008.jpg" alt=""></span>
  <span style="left: 103px; top: 233px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201009.jpg" alt=""></span>
  <span style="left: 205px; top: 0px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201010.jpg" alt=""></span>
  <span style="left: 205px; top: 78px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201011.jpg" alt=""></span>
  <span style="left: 205px; top: 155px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201012.jpg" alt=""></span>
  <span style="left: 205px; top: 233px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201001.jpg" alt=""></span>
  <span style="left: 308px; top: 0px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201013.jpg" alt=""></span>
  <span style="left: 308px; top: 78px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081201014.jpg" alt=""></span>
  <span style="left: 308px; top: 155px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081204wi21.jpg" alt=""></span>
  <span style="left: 308px; top: 233px; width: 93px; height: 68px; z-index: 93;">
  <img style="left: -11px; top: -9px;" src="images/08081204wi42.jpg" alt=""></span>
 </div>
 <div id="caption" style="position: absolute; width: 440px; height: 60px; left: -220px; top: 175px;">
  <b>carefully</b> weight the options</div>
</div>
<script type="text/javascript"><!--
// starter
load();
//-->
</script>

</body>

</html>

五常论坛是您快乐的网上家园,是您温馨的休闲港湾!
回复 支持 反对

使用道具 举报

1763

主题

1万

帖子

46万

积分

系统管理员

Rank: 10Rank: 10Rank: 10

积分
462646
金钱
157396
威望
182736
经验值
99357
魅力
2079
精华
13
QQ
地板
 楼主| 发表于 2009-9-23 09:42:58 | 只看该作者

<html>
<head>
<title>网页特效|Linkweb.cn/Js|---搜弧IT频道的幻灯片切换的特效源代码</title>

<body>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<DIV align=center>
<SCRIPT type=text/javascript>
<!--
t=3; //secs per slide

// promos + links
prmo = new Array();
link = new Array();

prmo[1]="http://www.webjx.com/img/200406301.jpg";//网页制作学习
link[1]="http://linkweb.cn/js";
prmo[2]="http://www.webjx.com/img/200406302.jpg";//动画制作学习
link[2]="http://linkweb.cn/js";
//prmo[2]="http://www.webjx.com/img/200406302.jpg"//网页特效
//link[2]="http://linkweb.cn/js";
prmo[4]="http://www.webjx.com/img/200406303.jpg";//网页编程学习
link[4]="http://linkweb.cn/js";
prmo[0]="http://www.webjx.com/img/200406304.jpg";//书籍教程下载
link[0]="http://linkweb.cn/js";
prmo[3]="http://www.webjx.com/img/200406305.jpg";//网页素材下载
link[3]="http://linkweb.cn/js";
//init
promos = "";
links = "";

// build flashvars
for (x=0;x<prmo.length;x++) {
 promos += (x+1<prmo.length) ? prmo[x]+"|" : prmo[x];
 links += (x+1<prmo.length) ? link[x]+"|" : link[x];
}

var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if ( plugin ) {
     var words = navigator.plugins["Shockwave Flash"].description.split(" ");
     for (var i = 0; i < words.length; ++i)
     {
  if (isNaN(parseInt(words)))
  continue;
  var MM_PluginVersion = words;
     }
 var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
   && (navigator.appVersion.indexOf("Win") != -1)) {
 document.write('<SCR' + 'IPT LANGUAGE=VBScript> \n'); //FS hide this from IE4.5 Mac by splitting the tag
 document.write('on error resume next \n');
 document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
 document.write('</SCR' + 'IPT> \n');
}

if ( MM_FlashCanPlay ) {
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="410" height="200" align="middle">');
 document.write('<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="http://www.webjx.com/js/img.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="wmode" value="transparent" />');
 document.write('<param name="FlashVars" value="p=' + promos + '&l=' + links + '&t=' + t + '">');
 document.write('<embed src="http://www.webjx.com/js/img.swf" FlashVars="p=' + promos + '&l=' + links + '&t=' + t + '" quality="high" bgcolor="#ffffff" width="410" height="200" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />');
 document.write('</object>');
}
//-->
  </SCRIPT>
</DIV></TD></TR></TBODY></TABLE>

<body>
</html>

五常论坛是您快乐的网上家园,是您温馨的休闲港湾!
回复 支持 反对

使用道具 举报

1763

主题

1万

帖子

46万

积分

系统管理员

Rank: 10Rank: 10Rank: 10

积分
462646
金钱
157396
威望
182736
经验值
99357
魅力
2079
精华
13
QQ
5#
 楼主| 发表于 2009-9-23 09:43:40 | 只看该作者

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页特效|Linkweb.cn/Js|---可控制的用FLASH控件实现的图片渐显JS效果</title>
</head>

<body>
<SCRIPT type=text/javascript>
 <!--
 
 var focus_width=257
 var focus_height=192
 var text_height=20
 var swf_height = focus_height+text_height
 
 var pics='Images/test001.jpg|Images/test002.jpg|Images/test003.jpg|Images/test004.jpg|Images/test004.jpg'
 var links='http://linkweb.cn/Js/Js.asp?ID=535|http://linkweb.cn/Js/Js.asp?ID=518|http://linkweb.cn/Js/Js.asp?ID=497|http://linkweb.cn/Js/Js.asp?ID=480|http://linkweb.cn/Js/Js.asp?ID=480'
 var texts='FLASH图片渐显效果测试|这种效果到底是怎么实现的呢|现在估计是JS和FLASH共同作用|那个FLASH文件应该是控制文件|现在估计是JS和FLASH共同作用'
 
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="Images/flash01.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
 document.write('<embed src="Images/flash01.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');  
 document.write('</object>');
 
 //-->
</SCRIPT>
</body>

</html>

五常论坛是您快乐的网上家园,是您温馨的休闲港湾!
回复 支持 反对

使用道具 举报

1763

主题

1万

帖子

46万

积分

系统管理员

Rank: 10Rank: 10Rank: 10

积分
462646
金钱
157396
威望
182736
经验值
99357
魅力
2079
精华
13
QQ
6#
 楼主| 发表于 2009-9-23 09:45:45 | 只看该作者

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页特效|Linkweb.cn/Js|---图片上滚动发光效果</title>
</head>
<body>

<SCRIPT LANGUAGE="JavaScript">
i=0;
function f_wave()
{i=i-4;
ShowCool.style.filter="Wave(Freq=1,LightStrength=80,Phase=" + i + ")";
setTimeout("f_wave()",100);
}
window.onload=f_wave;</SCRIPT>
<IMG SRC="Images/flag.jpg" WIDTH="85" HEIGHT="55" ID=ShowCool>

</body>
</html>
http://www.51bestwedding.cn/html/images/topflash.swf

五常论坛是您快乐的网上家园,是您温馨的休闲港湾!
回复 支持 反对

使用道具 举报

9

主题

184

帖子

4万

积分

五常五星居民

Rank: 9Rank: 9Rank: 9

积分
46071
金钱
40011
威望
3996
经验值
1696
魅力
0
精华
0
7#
发表于 2009-9-23 15:38:49 | 只看该作者

不好意思,请教晨曦:

上面这些语句怎么运行,在什么环境下运行?它属于什么语言?

我一点也没学过,想学会它,哪里有教的?

谢谢。

回复 支持 反对

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

QQ|手机版|小黑屋|Archiver|五常信息网(五常论坛) ( 黑ICP备06006344号

GMT+8, 2024-5-4 07:02 , Processed in 0.078072 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表