salvattore

A jQuery Masonry alternative with CSS-driven configuration.

  • 所有者: rnmp/salvattore
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Salvattore

![Gitter](https://badges.gitter.im/Join Chat.svg)

Salvattore is a library agnostic JS script that will help you organize your HTML elements according to the number of columns you specify, like jQuery Masonry.

Features

  • No requirements: Salvattore is a standalone script, it will work right away after being referenced in your HTML page.
  • Extremely lightweight: about 2.7KB (minified and gzipped.)
  • CSS-driven configuration: the number of columns is defined in CSS and the styling is left to the user.
  • Media queries ready: the same parameters can be used inside media queries for better results on different devices.
  • Wide browser support: modern browsers and IE9+

Upcoming

  • Balanced columns: to keep all columns about the same height.

To find out more and see it in action, please visit our website.

You can also follow us on Twitter.

Methods

Methods can be called on the globally exposed salvattore object for advanced usage.

var grid = document.querySelector('#grid');
var item = document.createElement('article');

salvattore.appendElements(grid, [item]);
item.outerHTML = 'I’ve been appended!';

Method, Argument, Description
------, --------, -----------
appendElements, grid : DOM object, elements: Array of DOM objects, Adds elements to the end of a grid.
prependElements, grid : DOM object, elements: Array of DOM objects, Adds elements to a beginning of a grid. Adds multiple elements one by one before each other, so note the order.
registerGrid, grid : DOM object, Adds a new grid to salvattore. Which is initialized automatically then.
recreateColumns, grid : DOM object, Removes all the columns from the grid, and adds them again.
rescanMediaQueries, Checks stylesheets and selectors for media queries again. Recreates the columns for all grids afterwards.

How to contribute

We use Gulp to add polyfills and minify the script in the dist/ folder. To make changes to the script itself, please edit src/salvattore.js and send us a pull request.

Share feedback & ideas

You can even contribute by using Salvattore and sharing bugs, ideas or solutions on the Issues page.
Protip: if you're posting a bug please share all the relevant data and ideally a live URL so that we can debug (yeah we do that!)

主要指标

概览
名称与所有者rnmp/salvattore
主编程语言JavaScript
编程语言CSS (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2013-03-14 05:36:48
推送于2018-03-02 16:40:52
最后一次提交2015-11-05 20:38:01
发布数10
最新版本名称v1.0.9 (发布于 2015-11-05 20:38:52)
第一版名称v1.0.0 (发布于 )
用户参与
星数2.2k
关注者数65
派生数241
提交数145
已启用问题?
问题数192
打开的问题数117
拉请求数19
打开的拉请求数3
关闭的拉请求数3
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?