我有一个jquery幻灯片,它使用导航列表来切换幻灯片图像.它的工作原理是当您将鼠标悬停在导航列表上时,它突出显示('.active')并且关联的图像会切换到该列表.导航列表中有链接,也可以单击这些链接转到其他页面.
我需要这个在平板电脑上工作,这样当人们点击导航列表时,它会变为活动状态,然后图像幻灯片切换,然后如果再次点击它会跟随到该链接.现在发生的事情是,只要点击它,它就会变为活动状态并点击进入.
这是jquery
$(".main_image .desc").show(); //Show Banner
$(".main_image .block").animate({ opacity: 0.8 }, 1 ); //Set Opacity
//Click and Hover events for thumbnail list
$(".image_thumb ul li:first").addClass('active');
$(".image_thumb ul li").hover(function(e){
//Set Variables
e.preventDefault();
var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
var imgTitle = $(this).find('a.imgloc').attr("href"); //Get Main Image URL
var imgDesc = $(this).find('.block').html(); //Get HTML of block
var imgDescHeight = $(".main_image").find('.block').height(); //Calculate height of block
if ($(this).is(".active")) { //If it's already active, then...
return false; // Don't click through
} …Run Code Online (Sandbox Code Playgroud)