账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    javaScript DOM 编程技术 最后一个案例
    47
    0

    在网上找教程 看到各位大神都推荐这本书,前面都还好遇到问题都自己解决了,就卡在最后一个案例了,有人帮我看看哪里出错了吗。。?

    javaScript DOM 编程技术的一个例子

    function prepareSlideshow() {
        if (!document.getElementsByTagName) return false;
        if (!document.getElementById) return false;
        if (!document.getElementById("intro")) return false;
        var intro = document.getElementById("intro");
        var slideshow = document.createElement("div");
        slideshow.setAttribute("id", "slideshow");
        var preview = document.createElement("img");
        preview.setAttribute("src", "images/slideshow.jpg");
        preview.setAttribute("alt", "what awaits you");
        preview.setAttribute("id", "preview");
        slideshow.appendChild(preview);
        insertAfter(slideshow, intro);
    
        var links = intro.getElementsByTagName("a");
        var destination;
        for (var i = 0; i < links.length; i++) {
            links[i].onmouseover = function () {
                destination = this.getAttribute("href");
                if (destination.indexOf("index.html") != -1) {
                    moveElement("preview,0,0,5");
                }
                if (destination.indexOf("about.html") != -1) {
                    moveElement("preview,150,0,5");
                }
                if (destination.indexOf("live.html") != -1) {
                    moveElement("preview,300,0,5");
                }
            }
        }
    
    }
    addloadEvent(prepareSlideshow);

    前面图片都添加成功了,但是后面的滑动功能 不管用

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 0
    • 色牲 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部