>
百度有啊通欄展示效果 body,div,dl,dt,dd ,ul,li,h3{margin:0;padding:0;}
body{color:#333;font:12px/1.5 arial;}
li {list-style:none;}
a :link,a:visited,a:active{color:#333;text-decoration:none;}
a:hover{color:#F30;}
img{border:none;}
# box{width:740px;margin:10px auto;}
#container{position:relative;height:232px;background:#FCFCFC;}
#container .項目{位置:絕對;頂部:0;左:: 0;寬度:492px;高度:230px;溢出:隱藏;背景:#FAFAFA;邊框:1px實體#ddd;z-index:1;不透明度:1;}
#container .item .pic{float: left;width:210px;height:200px;display:inline;margin:15px;}
#container .item .pic img{width:210px;height:200px;vertical -align:top;#s .item .txt{float:left;width:250px;margin-top:12px;}
#container .item .txt dt{font-size:14px;font-重量:700;}
#container . item .txt .info{顏色:#999;}
#container .item .txt dd{高度:24px;行高:24px;}
#container .item .txt dd span{float:left;
#container .item .txt .star{position:relative;float:left;height:12px;width:69px;margin:6px 0 0 5px;}
#container .item .starstar . position:absolute;top:0;left:0;height:12px;width:69px;z-index:2;background:url(http://js.fgm. cc/learn/lesson10/img/youa/star. png) 重複x 滾動左上透明;}
#container .item .txt .star .star_grey{background:url(http://js.fgm.cc /learn/lesson10/img/youa/star.png) 重複x 向左捲動-15px 透明;高度:12px;寬度:69px;}
#container .item .txt .pink,#container .item .txt .藍色,#container .item .txt .green{顏色: #FFF;font-weight:700;margin-right:2px;背景:#F66B5B;padding:0 5px;}
#container .item .txt .blue {背景:#96BAE7;}
#container . item .txt .green{背景:#9CDBC3;}
#container .item .txt .comment{寬度:232px;高度:99px;邊距頂部:10px ;背景:#FFF;邊框:1px 實心#EAEAEA; }
#container .item .txt .comment h3{字體大小:12px;字體粗細:400;高度:24px;行高:24px;邊框-bottom:1pxsolid #E9E9E9;padding:0 10pxx; #container .item .txt .comment .comment_list{寬度:220px;高度:60px;溢出:隱藏;邊距:8px 0 0 10px;}
#container .item .txt .comment .comment_list ul{width: ;}
#container .item .txt .comment .comment_list ul li{height:20px;line-height:20px;white-space:nowrap; }
#container .item .txt .comment .comliment_list ul . b{color:#999;font-weight:400;}
#control{height:37px;text-align:center;background:url( http://js.fgm.cc/learn/lesson10/img/ youa/bg.png) no-repeat;}
#control span{width:8px;height:8px;font-size:0;line-高度:0;遊標:指標;顯示:內聯塊;背景顏色:#FEFEFE;邊框:1px實體#BCC1C5;邊距:13px 2px 2px;}
#control span.active{背景顏色:#848484 ;邊框:1px實線#6E6E6E;}
;
function Youa (obj)
{
this.obj = $(obj);
this.container = $("容器" );
this.control = $("control");
this.items = $$$("item", this.container);
this.iCenter = 2;
this. aSort = [];
this.timer = null;
this.oData = [
{left:0, zIndex:2, opacity:30},
{left:40, zIndex:3 , opacity:60},
{left:124, zIndex:4,不透明度:100},
{左:208,zIndex:3,不透明度:60},
{左:246, zIndex:2,不透明度:30},
{左:40 , zIndex:0, 不透明度:0}
];
this.__create__()
};
Youa. prototype.__create__ = function ()
{
var that = this;
var oSpan = null;
var i = 0;
for (i = 0; i {
that.items[i].number = i;
that.aSort[i] = that.items[i];
oSpan = document.createElement("span ");
oSpan.number = i;
that.control.appendChild(oSpan)
}
for (i = 0; i that.aSpan = $$("span", that.control);
that.control.onmouseover = function (ev)
{
var oEv = ev ||事件;
var oTarget = oEv.target || oEv.srcElement;
if (oTarget.tagName.toUpperCase() == "SPAN")
{
that.aSort.sort( function (a, b) {return a.number - b.number});
if (oTarget.number {
for (i = 0; i that.__set__();
回傳false
}
else if (oTarget.number > that.iCenter)
{
for (i = 0; i
that.__set__ ();
回傳false
}
else
{
that.__set__()
}
}
}
this.__set__();
this.__switch__();
這個.__autoPlay__()
};
Youa.prototype.__set__ = function ()
{
var i = 0;
for (i = 0; i < this.aSort.length; i++) this.container.appendChild(this.aSort[i]);
for (i = 0; i < this.aSpan.length; i++) this.aSpan[i].className = "";
this.aSpan[this.aSort[this.iCenter].number].className = "active";
for (i = 0; i < this.aSort.length; i++)
{
this.aSort[i].index = i;
if (i < 5)
{
new Animate(this.aSort[i], this.oData[i]);
}
else
{
new Animate(this.aSort[i], this.oData[this.oData.length - 1])
}
}
};
Youa.prototype.__switch__ = function ()
{
var i = 0;
var that = this;
this.container.onclick = function (ev)
{
var oEv = ev || event;
var oTarget = oEv.target || oEv.srcElement;
var index = findItem(oTarget);
if (index < that.iCenter)
{
for (i = 0; i < that.iCenter - index; i++) that.aSort.unshift(that.aSort.pop());
that.__set__();
return false
}
else if (index > that.iCenter)
{
for (i = 0; i < index - that.iCenter; i++) that.aSort.push(that.aSort.shift());
that.__set__();
return false
}
function findItem (element)
{
return element.className == "item" ? element.index : arguments.callee(element.parentNode)
}
};
};
Youa.prototype.__autoPlay__ = function ()
{
var that = this;
that.timer = setInterval(function ()
{
that.aSort[3].click()
}, 3000);
that.obj.onmouseover = function ()
{
clearInterval(that.timer)
};
that.obj.onmouseout = function ()
{
that.timer = setInterval(function ()
{
that.aSort[3].click()
}, 3000)
}
};
function $ (id)
{
return typeof id === "string" ? document.getElementById(id) : id
};
function $$ (tagName, oParent)
{
return (oParent || document).getElementsByTagName(tagName)
};
function $$$ (className, element, tagName)
{
var i = 0;
var aClass = [];
var reClass = new RegExp("(^|//s)" + className + "(//s|$)");
var aElement = $$(tagName || "*", element || document);
for (i = 0; i < aElement.length; i++) reClass.test(aElement[i].className) && aClass.push(aElement[i]);
return aClass
};
function css (element, attr, value)
{
if (arguments.length == 2)
{
if (typeof arguments[1] === "string")
{
return element.currentStyle ? element.currentStyle[attr] : getComputedStyle(element, null)[attr]
}
else
{
for (var property in attr)
{
property == "opacity" ?
(element.style.filter = "alpha(opacity=" + attr[property] + ")", element.style.opacity = attr[property] / 100) :
element.style[property] = attr[property]
}
}
}
else if (arguments.length == 3)
{
switch (attr)
{
case "width":
case "height":
case "top":
case "left":
case "right":
case "bottom":
element.style[attr] = value + "px";
break;
case "opacity" :
element.style.filter = "alpha(opacity=" + value + ")";
element.style.opacity = value / 100;
break;
default :
element.style[attr] = value;
break
}
}
return element
};
function Animate (element, options, fnCallBack)
{
this.obj = $(element);
this.options = options;
this.__onEnd__ = fnCallBack;
this.__startMove__()
};
Animate.prototype.__startMove__ = function ()
{
var that = this;
clearInterval(that.obj.timer);
that.obj.timer = setInterval(function ()
{
that.__doMove__()
}, 30);
};
Animate.prototype.__doMove__ = function ()
{
var complete = true;
var property = null;
for (property in this.options)
{
var iCur = parseFloat(css(this.obj, property));
property == "opacity" && (iCur = parseInt(iCur.toFixed(2) * 100));
var iSpeed = (this.options[property] - iCur) / 5;
iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed);
this.options[property] == iCur || (complete = false, css(this.obj, property, iSpeed + iCur))
}
complete && (clearInterval(this.obj.timer), this.__onEnd__ && this.__onEnd__.apply(this.obj))
};
window.onload = function ()
{
new Youa("box")
};
- 必图拳馆
- 不要把自己困住 你需要释放!
- 总体评价:
- 用户印象:过瘾带劲有活力
- 慕纱莹雪婚纱礼服馆
- 物超所值的性价比,尽在慕纱莹雪!
- 总体评价:
- 用户印象:精致做工好专业
- 北京心拓城拓展培训
- 客户第一 执行有力 激情勤奋 简单团结
- 总体评价:
-
使用者印象:專業安全積極
- 羅曼卡婚禮攝影
- 口碑好性價比高無額外消費
-
整體評價:
使用者印象:口碑好很喜歡完美
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
作者最新文章
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31
用户评价