AshesOfOwls / jquery.shapeshift

A dynamic grid system with drag and drop functionality.
http://ashesofowls.github.com/jquery.shapeshift/
MIT License
1.67k stars 311 forks source link

lock child in position, shapeshift rest? possible? #113

Open anthonyth opened 9 years ago

anthonyth commented 9 years ago

im working on something whereby people drag divs from one container to the other and then using shapeshift to reorganise the child elements accordingly.. but it would be great if when certain child elements are in the correct place they could be locked from being included in further shapeshifts..

is this possible by changing the div class or something?

crasyboy42 commented 9 years ago

You can add a selector on elements that could be shapeshifted, this is a jquery selector so you can use :not psuedo selector.

This is not tested but you could play around with it

$container.shapeshift({
    selector: "*:not('.class')"
});

Hope this solves your issue :)

gabryk91 commented 6 years ago

I have this, @crasyboy42 can you suggest me where I have to add the selector to lock a child element? Thanks

<script type='text/javascript'>//<![CDATA[
        $(window).load(function () {
            $(".container").shapeshift({
                minColumns: 2,
                align: "left"

            }).on("ss-added", function (e, selected) {
                var idAttivita = $(selected).attr("id");
                var idTargetDiv = $(this).attr("id");
                __doPostBack('modificaAttivita', idAttivita + ";" + idTargetDiv);
                //alert(idAttivita + ";" + idTargetDiv); // Returns the index position.
            });

        });//]]> 
</script>