jonobr1 / stalactite

stalactite is a jQuery plugin that packs child elements together.
http://jonobr1.github.com/stalactite
154 stars 32 forks source link

Adding px to 'margin-top' #7

Closed FlxSaenger closed 9 years ago

FlxSaenger commented 9 years ago

Ahoy, first of all: Thx for this great plugin, it's exactly doing, what it's supposed to :)

I'm not a particular JavaScript-dev, so I'm asking myself if there is a way to increase the automatically generated "margin-top"-attribute, so that each item NEEDS to have at least "margin-top: 20px" instead of 0px?! Putting this within stalactite's "style"-option doesn't make much sense, of course.

Thanks again, Felix

jonobr1 commented 9 years ago

Thanks for the post @FlxAlbroscheit. Currently there isn't a way to do this because stalactite is dynamically calculating and using the margin-top value to place all the content vertically. The way around this is to wrap all children of the container element in say a div and add padding-top to it. e.g: http://jsfiddle.net/jonobr1/crv61p69/1/