圖片依序顯示
by Occur
HTML
<body>
<script type="text/javascript">
function thisTest()
{
this.textValue = 'this的dom测试';
this.element= document.createElement('span');
this.element.innerHTML = this.textValue;
this.element.style.color = "blue";
this.element.style.cursor = "pointer";
this.element.attachEvent('onclick', this.ToString);
}
thisTest.prototype.RenderDom = function()
{
document.body.appendChild(this.element);
}
thisTest.prototype.ToString = function()
{
alert("单击我:"+this.textValue);
};
var test= new thisTest();
test.RenderDom();
//test.ToString();
</script>
</body>
CSS
.productdemo {
border: 1px solid blue;
min-height: 60px;
min-width: 200px;
}
.productdemo img {
display:none;
}
JavaScript
function prodFadeIn() {
$('.productdemo img').first().fadeIn(1000, function() {
$(this).next().fadeIn(500, arguments.callee);
});
}
$(window).load(function() {
$('#play').click(function() {
$('.productdemo img').hide();
prodFadeIn();
});
});