[英]I have 9 small images that when clicked on, will fade in the bigger version of the image. Why wont work in Browser(FF))
<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"});
});
//note:hover function // note:悬停功能
//When user clicks on a small image with the prior image hover function, bigger versions on that image should fade in// //当用户使用先前的图像悬停功能单击小图像时,该图像上的较大版本应淡入//
$("#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>
Shouldn't it be: 不应该是:
<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="myCode.js"></script>
? ?
tag should be script
. 标签应该是
script
。
<script type="text/javascript" src="jquery-1.11.0.min.js"></script >
<script type="text/javascript" src="myCode.js"></script>
</body> //jquery is within my site directory on my desktop
$(document).ready(function(){
//note:
$(".img")
.mouseenter(function(){
$(this).animate({height:"125px",width:"136px"});
})
.mouseleave(function(){
$(this).animate({height:"118px",width:"129px"});
});
});
myCode.js myCode.js
$(document).ready(function(){
$(".big-img").hide();
$(".img").click(function(){
var id = $(this).data(id);
$("#"+id)
.fadeIn(2000)
.click(function(){
$(this).fadeOut(2000);
});
});
});
HTML image HTML图片
<img class="img" src="" data-id="artShow">
<img class="big-img" src="" id="artShow" >
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.