jquery - 在使用 jquery 加 css 单击向左或向右滑动 div

标签 jquery html css sliding

在下面的两张图片中,我试图描述我想在我的 jQuery 滑动中完成什么

there are multiple product boxes in my website

i need a popup next to particular clicked product and other product box should be moved to next line

IMAGE 01 :我的网站上有多个产品框

IMAGE 02:我需要在特定点击的产品旁边弹出一个窗口,其他产品框应该移到下一行

最佳答案

您可以通过隐藏描述并使用 jQuery 显示它们来实现。 问题是:如果你想让 desc div 推送产品 div,当你点击最后一列的产品时,它会很奇怪。

演示:http://jsfiddle.net/Paf_Sebastien/tzg3rswv/

/* jQuery */

$(function() {
    $('.product').click(function() {
        $('.desc').hide();
        $(this).next().css('display', 'inline-block');
    });
});

关于jquery - 在使用 jquery 加 css 单击向左或向右滑动 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29626546/

相关文章:

html - CSS div 与其内容一样宽

javascript - 如何减少 if-else 语句

javascript - 警告框消失,无需单击 ASP.NET 中的“确定”按钮

javascript - Jquery 动画和 css 左右

css - 有没有办法根据类以外的东西有条件地应用 CSS?

html - 应该只使用 overflow-x 而不是 overflow-y

html - 如何在下拉菜单旁边显示子菜单

javascript - jQuery 在第二次刷新之前不会加载数据

javascript - jQuery 点击函数在获取请求后不起作用

css - 多行垂直居中 <div>