如何使用此JQuery插件移动对象X位置?

时间:2022-07-06 00:55:09

http://desandro.com/demo/masonry/docs/

I got this to display nicely. But,

我得到这个很好地显示。但,

How can I modify this plugin so that when someone clicks an object, it does the nice "re-ordering" effect as seen in: http://desandro.com/demo/masonry/docs/filtering.html#demo

如何修改此插件,以便当有人点击某个对象时,它会执行良好的“重新排序”效果,如:http://desandro.com/demo/masonry/docs/filtering.html#demo

And it moves the object "X" positions up or down the list?

它会在列表中向上或向下移动对象“X”位置吗?

Is it easy to modify this to do that?

修改它是否容易做到这一点?

1 个解决方案

#1


0  

From the moment that all elements has float:left; when the user click the button hide the element with specific classes, for example if he clicks grey, then will hide red and black. In jquery the above example would be like this:

从所有元素浮动的那一刻起:左;当用户单击该按钮时,隐藏具有特定类的元素,例如,如果他单击灰色,则会隐藏红色和黑色。在jquery中,上面的例子是这样的:

$(document).ready(function(){
    $("#grey-button").click(function(){
        $(".red, .black").hide()
    });
});

This will hide all elements with classes red and black, adding the css property display and value none.

这将隐藏所有具有红色和黑色类的元素,添加css属性显示和值none。

This will make the browser don't "see" them, so the rest elements will be positioned in a different place, according the floats you have set for them.

这将使浏览器不“看到”它们,因此根据您为它们设置的浮动,其余元素将位于不同的位置。

#1


0  

From the moment that all elements has float:left; when the user click the button hide the element with specific classes, for example if he clicks grey, then will hide red and black. In jquery the above example would be like this:

从所有元素浮动的那一刻起:左;当用户单击该按钮时,隐藏具有特定类的元素,例如,如果他单击灰色,则会隐藏红色和黑色。在jquery中,上面的例子是这样的:

$(document).ready(function(){
    $("#grey-button").click(function(){
        $(".red, .black").hide()
    });
});

This will hide all elements with classes red and black, adding the css property display and value none.

这将隐藏所有具有红色和黑色类的元素,添加css属性显示和值none。

This will make the browser don't "see" them, so the rest elements will be positioned in a different place, according the floats you have set for them.

这将使浏览器不“看到”它们,因此根据您为它们设置的浮动,其余元素将位于不同的位置。