我在页面加载时显示第一个较大的图像, 但我想在单击缩略图时显示更大的图像,最初我不想在加载页面时显示任何更大的图像。最初只应显示缩略图。
这是尝试过的链接:
最佳答案
听起来你想要的是这样的:
$("#panel img").hide(); //<= remove the :not(first-child) filter
$("#thumbs .UiUx3DSSVFlow").click(function(){
getIndex = $(this).index();
$("#thumbs .clicked").removeClass('clicked');
$("#panel img").fadeOut('fast').eq(getIndex).fadeIn();
$(this).addClass('clicked');
});
//$("#thumbs .UiUx3DSSVFlow:first").click(); //<= don't simulate the first click
$(['next','prev']).each(function(){
var that=this;
$('.'+that).click(function(){
$('#thumbs .clicked')[that]().click();
});
});
关于javascript - 显示更大的初始图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12153438/