我正在使用jQuery图片库以各种颜色显示相同的产品.我想在点击时更改动画

I'm using an jQuery image gallery to show the same product in various colour. And i want to change the animation on click?

本文关键字:动画 显示 jQuery 图片库 颜色      更新时间:2023-09-26

我正在使用jQuery图片库以各种颜色显示相同的产品。我想在点击时更改动画?在每次点击的那一刻,都会产生一个从左侧扫入的图像。但是,对于我的网站来说,它太闪光了,我想简单地替换图像永远不会离开屏幕的过渡。谁能帮忙?

这是我的jQuery:

<script>
$(document).ready(function () {
$("#red").click(function () {
    $("#img-red").show('');
$("#img-etchedglass, #img-blue, #img- green").hide();
});
$("#blue").click(function () {
    $("#img-blue").show('');
    $("#img-etchedglass, #img-red, #img-green").hide();
});
$("#green").click(function () {
    $("#img-green").toggle('');
    $("#img-etchedglass, #img-red, #img-blue").hide();
});
});
$("#etchedglass").click(function () {
    $("#img-etchedglass").show('');
    $("#img-blue, #img-red, #img-green").hide();
});

在jQuery方面,我是一个新手,所以任何帮助都值得赞赏!

您可以

尝试将动画持续时间设置为 0。只需使用隐藏(0)或显示(0);