我试图隐藏,显示,移动图像,但我无法做任何事情。我看到按钮,但没有发生任何事情。 jQuery的链接是错误的还是其他的东西?我所做的没有任何事情似乎有效。不知道在这一点上做的......我无法让jQuery工作。我错过了什么?
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>jQuery</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link type="text/css" rel="stylesheet" href="jquery.css"/>
<script type="text/javascript">
$(document).ready(function() {
$("img").addClass("wrappedElement");
$("#Hide All Images").click(function(){
$("img").hide("fast");
});
$("#Show All Images").click(function(){
$("img").show("fast");
});
$("#Show Even Images").click(function() {
if ($("img:even").is(':visible') && $("img:odd").is(':visible')) {
$("img:odd").toggle("fast");
}else{
$("img:even").show("fast");
}
});
$("#Show Odd Images").click(function(){
if ($("img:odd").is(':visible') && $("img:even").is(':visible')) {
$("img:even").toggle("fast");
}else{
$("img:odd").show("fast");
}
});
$("#Right Shift").click(function(){
$("img").slideRight();
});
$("#Left Shift").click(function(){
$("img").slideLeft();
});
});
</script>
<body>
<div id="header">
<button id="Hide All Images">Hide All Images</button>
<button id="Show Even Images">Show Even Images</button>
<button id="Show Odd Images">Show Odd Images</button>
<button id="Right Shift">Right Shift</button>
<button id="Left Shift">Left Shift</button>
</div>
<div id ="content">
<img class="photo" src="photo_one.jpg" alt="one">
<img class="photo" src="photo_two.jpg" alt="two">
<img class="photo" src="photo_three.jpg" alt="three">
<img class="photo" src="photo_four.jpg" alt="four">
<img class="photo" src="photo_five.jpg" alt="five">
</div>
</body>
你的链接,jQuery的为m以'http:'作为前缀。 –
哦不工作我认为你的意思是点击事件是由mouseOvers触发的? – Rooster
@TravisJ不需要。推荐使用无协议的URI – Phil