ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.04k stars 1.2k forks source link

If you are looking for a responsive gridster, you can try this #604

Open johe-a opened 5 years ago

johe-a commented 5 years ago

My English is poor, this is my first time to open an issue. If you want a responsive gridster, you can try this :

function girdsterResize ( ){
        //use the resize_widget_dimensions method, the variable baseDiemensionWidth is measured by yourself according to the container of gridster
        gridsterObj.resize_widget_dimensions({
            widget_base_dimensions: [baseDiemensionWidth, 100]
        });
    };

I found this answer from the Issues, but I also found it not work when I change to another router( i am using Angular to do a SPA) After I debug my programmer , i found the solution to resolve this question. At the source code of jquery.gridster.js, the method _add_styletag has an if statement

if (!document.getElementById(cssID)) 

Gridster.js create the