$(document).ready(function() {
// ............. Your jQuery Code goes here .............
//var myArray1 = new Array( "img1", "img2" , "img3", "img4");
var numImg = $('#thumbNail img').length; //number of images
var num = 0;
var curImg = 0;
//Prevent Image Dragging
$("img").bind('contextmenu', function(e) {
return false;
});
//Prevent Right Click on Mouse
$("img").bind("mousedown", function(e){
return false;
});
$(".leftThumbNail").live("click", function(){
alert("HY");
});
});
当我单击“leftThumbnail”类中的图像时,我试图让它做出反应。此类在左侧面板上包含 2 个图像。每当我单击该课程中的任何图像时,似乎都没有发生任何事情。
我也试过:
$(".leftThumbNail").click(function() {
alert("HEY");
});
在我的“leftThumbNail”类中,我有以下内容:
<div class="leftThumbNail">
<img id = "img1" src="img/thumb/image1.jpg" class = "image1Position" alt="Image 1">
<img id = "img2" src="img/thumb/image2.jpg" class = "image2Position" alt="Image 2" >
</div>