+ -
当前位置:首页 → 问答吧 → 顶部图片伸缩问题

顶部图片伸缩问题

时间:2010-06-01

来源:互联网

var showAD = {
                curve: function(t, b, c, d, s) {
                    if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
                    return c / 2 * ((t -= 2) * t * t + 2) + b
                },
                fx: function(from, to, playTime, onEnd) {
                    var Me = this,
                    who = this.adWrap,
                    position = 0,
                    changeVal = to - from,
                    curve = this.curve;
                    playTime = playTime / 10;
                    who.style.overflow = 'hidden';
                    function _run() {
                        if (position++<playTime) {
                            who.style.height = Math.max(1, Math.abs(Math.ceil(curve(position, from, changeVal, playTime)))) + "px";
                            setTimeout(_run, 10)
                        } else {
                            onEnd && onEnd.call(Me, to)
                        }
                    };
                    _run()
                },
                init: function(info) {
                    var Me = this,
                    loadImg = new Image;
                    loadImg.src = info.endImgURL;
                    window.onload=function() {
                                          menuFix();
                        Me.endImgURL = info.endImgURL;
                        Me.img = document.getElementById(info.imgID);
                        Me.adWrap = document.getElementById(info.adWrapID);
                        var max = Me.img.height;
                        setTimeout(function() {
                            Me.fx(max, 0, 500,
                            function(x) {
                                this.img.src = this.endImgURL;
                                this.curve = function(t, b, c, d) {
                                    if ((t /= d) < (1 / 2.75)) {
                                        return c * (7.5625 * t * t) + b
                                    } else if (t < (2 / 2.75)) {
                                        return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b
                                    } else if (t < (2.5 / 2.75)) {
                                        return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b
                                    } else {
                                        return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b
                                    }
                                };
                                this.fx(0, this.img.height,600)
                            })
                        },
                        info.timeout || 1000)
                    };
                }
            };
            showAD.init({
                adWrapID: 'ad_box',
                imgID: 'adImg',
                endImgURL: 'skin_a/images/a.jpg'/*endImgURL: 'skin_a/images/a.swf'*/
            });

这段代码图片支持了 但是客户要收回去后显示成flash那样可以动的

请问如何插flash进去

作者: sydpoechang   发布时间: 2010-06-01

<!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 http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>无标题文档</title>
<script type="text/javascript" src="skin_a/images/ad.js" ></script>
<body>
<div id="ad_box"><img src="skin_a/images/b.jpg" id="adImg"/></div>
</body>
</html>

不要意思忘了页面显示代码 现在补上

作者: sydpoechang   发布时间: 2010-06-01

相关阅读 更多

热门下载

更多