简体   繁体   English

jQuery显示特定元素,然后在选择另一个元素时隐藏

[英]jquery show specific element then hide when another is selected

I'm using slider and having it open up on a specific image when the page loads. 我正在使用滑块,并在页面加载时在特定图像上打开它。 That happens just fine, only when I go to select another image it stays visible as the other one also pops up. 发生这种情况很好,只有当我选择另一个图像时,它仍然可见,因为另一个图像也会弹出。 Here is my current code for forcing it to appear. 这是强制其显示的当前代码。

    <script>
$(document).ready(function(){
    $("#793").show();  
});
</script>

the page can be seen here, select another image at the bottom and you'll see what I mean. 您可以在此处看到该页面,在底部选择另一张图片,您会明白我的意思。 http://www.shehitpausestudios.com/index.php/shop/polaroids/girls-and-dreams/last-summer/ http://www.shehitpausestudios.com/index.php/shop/polaroids/girls-and-dreams/last-summer/

maybe try something like this 也许尝试这样的事情

$(".bjqs li div").click(function(){
        $(".person_about").hide();
        var image = $(this).attr("data-rel");
        var div = image.replace('#','');
        $(".person_about #"+div).show(); 
       return false;
    });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM