0.0.0 ⢠Published 11 years ago
lazyplace v0.0.0
lazyplace
A Node module to set element sizes of HTML.
<div class='.responsive-image-wrapper'>
<img alt='' src='placeholder.gif' data-src='image_ratio-16-9.jpg'>
</div>ā
<div class='.responsive-image-wrapper' styles='height: 0; padding-bottom: 56.25%;'>
<img alt='' src='placeholder.gif' data-src='image_ratio-16-9.jpg'>
</div>Installation
Install with npm. (Make sure you have installed Node.)
npm install --save lazyplaceAPI
var lazyPlace = require('lazyplace');lazyPlace(filename, options, callback)
options.attr
Type: String (Required)
options.selector
Type: String (Required)
options.baseDir
Type: String
options.responsive
Type: Boolean
It returns a Number of heading level, when the argument is a heading tag name, such as "h3" and "H4".
It returns null when the argument is not a heading tag name.
It throws an error when the argument is not a String.
var result = [];
for(var i = 0; i <= 7; i++) {
result.push(headingLevel('h' + i));
}
result; //=> [null, 1, 2, 3, 4, 5, 6, null]lazyPlace.htmlString(string, options, callback)
License
Copyright (c) 2014 Shinnosuke Watanabe
Licensed under the MIT LIcense.
0.0.0
11 years ago