javascript - 我有 9 个小图像,单击这些图像时,它们会在较大版本的图像中淡出。为什么在浏览器中不起作用(FF))

标签 javascript jquery html

<style type="text/javascript" src="jquery-1.11.0.min.js"></style>
<style type="text/javascript" src="myCode.js"></style>
</body> //jquery is within my site directory on my desktop


$(document).ready(function(){
//note:
$("#artShow,#changreImage,#clasziImage,#comicImage,#planetImage,#dragonImage,#wineImage,#underwaterImage,#catImage").mouseenter(function(){
$(this).animate({height:"125px",width:"136px"});
    });
$("#artShow,#changreImage,#clasziImage,#comicImage,#planetImage,#dragonImage,#wineImage,#underwaterImage,#catImage").mouseleave(function(){
$(this).animate({height:"118px",width:"129px"});
    });

//注意:悬停函数

//当用户点击带有先前图像悬停功能的小图像时,更大的版本 该图像应该淡入//

$("#big").hide();
    $("#artShow").click(function(){
        $("#big").fadeIn(2000);
            $("#big").click(function(){
                $("#big").fadeOut(2000);
                });

    });

        $("#big2").hide();
    $("#changreImage").click(function(){
        $("#big2").fadeIn(2000);
            $("#big2").click(function(){
                $("#big2").fadeOut(2000);
                });
    });

            $("#big3").hide();
        $("#clasziImage").click(function(){
            $("#big3").fadeIn(2000);
                $("#big3").click(function(){
                    $("#big3").fadeOut(2000);
                });
        });

            $("#big4").hide();
            $("#comicImage").click(function(){
                $("#big4").fadeIn(2000);
                    $("#big4").click(function(){
                        $("#big4").fadeOut(2000);
                    });
                });

                    $("#big5").hide();
                    $("#planetImage").click(function(){
                        $("#big5").fadeIn(2000);
                            $("#big5").click(function(){
                                $("#big5").fadeOut(2000);
                            });
                        });

                            $("#big6").hide();
                            $("#dragonImage").click(function(){
                                $("#big6").fadeIn(2000);
                                    $("#big6").click(function(){
                                        $("#big6").fadeOut(2000);
                                    });
                                });

                                    $("#big7").hide();
                                    $("#wineImage").click(function(){
                                        $("#big7").fadeIn(2000);
                                            $("#big7").click(function(){
                                                $("#big7").fadeOut(2000);
                                            });
                                        });

                                            $("#big8").hide();
                                            $("#underwaterImage").click(function(){
                                                $("#big8").fadeIn(2000);
                                                    $("#big8").click(function(){
                                                        $("#big8").fadeOut(2000);
                                                    });
                                                });

                                                    $("#big9").hide();
                                                    $("#catImage").click(function(){
                                                        $("#big9").fadeIn(2000);
                                                            $("#big9").click(function(){
                                                                $("#big9").fadeOut(2000);
                                                            });
                                                        });

});

最佳答案

<style type="text/javascript" src="jquery-1.11.0.min.js"></style>
<style type="text/javascript" src="myCode.js"></style>

不应该是:

<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="myCode.js"></script>

关于javascript - 我有 9 个小图像,单击这些图像时,它们会在较大版本的图像中淡出。为什么在浏览器中不起作用(FF)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21589648/

相关文章:

javascript - 悬停滑动选项卡机制

jQuery - 获取邻域元素

javascript - 刷新时图像变化的顺序

javascript - 按下图像后在网站上重新加载 Javascript(函数)

javascript - indexOf 和 lastIndexOf 在不同的情况下给出相同的东西

javascript - 为不同的浏览器窗口大小选择不同的CSS样式表?

javascript - 无法在 Internet Explorer 中使用 <选择多个必需> 提交表单

javascript - 在 pixi.js 中初始加载后访问纹理

javascript - 为什么在尝试更改链接属性时,即使控制台输出正确的结果,DOM 仍保持不变?

javascript - 使用POST将js变量从iframe发送到php