常见问题当前位置:星鸿娱乐 > 常见问题 > >

星鸿娱乐平台:js钢琴按钮波浪式图片排列效果代

    

  ??  ??  ??  ??  ??  ??  ??  ??  ??  ??  ??  ??  ??  ??  
  var Bookrack=function(a, b, c, e) {  this.scale=e || 0.1;  this.x=b || 120;  this.y=c || 160;  this.border=2;  this.init(a);  this.exec(Math.ceil(Math.random() * this.imgs.length))  };  Bookrack.prototype={  init: function(a) {? his.width=a.clientWidth - 2 * this.x * this.scale;  a.style.position="relative";  a.style.height=this.y + "px";  this.imgs=a.getElementsByTagName("a");  var b=this,  c=document.createElement("span"),  e,  d;  this.each(function(a, g) {  a.style.position="absolute";  a.style.bottom="0";  a.style.border=this.border + "px solid gray";  a.style.left=this.width * (g / this.imgs.length) + 2 * this.border + "px";  a.setAttribute("dir", g);  d=a.getElementsByTagName("img")[0].getAttribute("alt").split("|");  e=c.cloneNode(!0);  e.innerHTML=a.getAttribute("title");  a.appendChild(e);  a.onmouseover=function() {  b.exec(this.getAttribute("dir"))  }  })  },  each: function(a) {  for (var b=0,  c; c=this.imgs[b++];) a.call(this, c, b, this.imgs.length)  },  color: function(a) {  a=(~~ (255 * a)).toString(16);  2 > a.length && (a="0" + a);  a=a.substr(0, 2);  return "#" + a + a + a  },  exec: function(a) {  this.each(function(b, c, e, d, f) {  b.getElementsByTagName("span")[0].style.display="none";  c==a && (b.getElementsByTagName("span")[0].style.display="block"); 星鸿娱乐注册 d=Math.min(c / a, a / c);  f=Math.sin(90 * (Math.PI / 180) * d) * (1 - this.scale);  b.style.zIndex=Math.ceil(1E4 * f);  b.style.borderColor=this.color(f + this.scale);  b.style.width=this.x * (f + this.scale) - 2 * this.border + "px";  b.style.height=this.y * (f + this.scale) - 2 * this.border + "px";  b.style.marginLeft=this.x * f / -2 + "px"  })  }  };  new Bookrack(document.getElementById('bookrack'), 120, 160);    

(责任编辑:admin)

上一篇:星鸿娱乐:jq实现左滑显示删除按钮,点击删除实

下一篇:jQuery操作表格(table)的常用方法、技巧汇总

推荐内容

客户服务热线

400 888 8932

在线客服