Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🔳 when you need more __space__. Quick margin/padding for your no-code tools.

License

NotificationsYou must be signed in to change notification settings

actuallyakash/spacers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

when you need more space

Demo

http://actuallyakash.github.io/spacers

Package Managers

# Bowerbower install --save spacersjs# NPMnpm install spacersjs

CDNs

# unpkg<linkrel="stylesheet"href="https://unpkg.com/spacersjs/spacers/spacers.min.css"/><scriptsrc="https://unpkg.com/spacersjs/spacers/spacers.min.js"></script># jsDelivr<linkrel="stylesheet"href="https://cdn.jsdelivr.net/npm/spacersjs/spacers/spacers.min.css"/><scriptsrc="https://cdn.jsdelivr.net/npm/spacersjs/spacers/spacers.min.js"></script># CDNjs<linkrel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/spacersjs/1.0.6/spacers.min.css"/><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/spacersjs/1.0.6/spacers.min.js"></script>

Bookmarklet

Try spacers quickly on any webpage through the bookmarklet.

#"script");spacerScript.type="text/javascript",spacerScript.src="https://cdn.jsdelivr.net/npm/spacersjs/spacers/spacers.min.js",document.getElementsByTagName("head")[0].appendChild(spacerScript);varspacersStyles=document.createElement("link");spacersStyles.rel="stylesheet",spacersStyles.type="text/css",spacersStyles.href="https://cdn.jsdelivr.net/npm/spacersjs/spacers/spacers.min.css",document.head.appendChild(spacersStyles),spacerScript.onload=function(){spacers({element:"*",showOnHover:!0,enableLock:!0,onDragEnd:function(e){console.log(e)}}),alert("Spacers active!")};})();

Note: May not work on some websites due to Content Security Policy.

Settings

OptionTypeDefaultDescription
elementstringnullSelector on which the spacer has to be initialized
appendHtmlstringbeginTo append spacer divs after or before the specifiedelement. Usebegin to append before the selector andend to append after the selector.
paddingbooleantrueTo enable padding, which is default behavior
marginbooleanfalseTo enable margin
onDragEndfunctionnullFunction for using the spacer values when drag is ended
containedAreaobject (DOM node or jQuery object) or window.documentUse if you're not able to find the element (ex- when using iframe)
spacerClassstringnullFor adding custom classes in the spacers
defaultSpacingstring8Initial starting spacer height.
defaultPaddingobjectnullan object with initial padding spacer top, bottom, left, right values. Overwrites thedefaultSpacing parameter
defaultMarginobjectnullan object with initial margin spacer top, bottom, left, right values. Overwrites thedefaultSpacing parameter
spacingUnitstringpxChange default spacing unit of spacers like em, rem, in, cm ..etc
showOnHoverbooleanfalseShow spacers only on hover
hideSpacingValuebooleanfalseHides the margin/padding values at the center of the spacer
showLabelstringnullEnable and set the label to specified string beside the spacing value
enableLockbooleanfalseLink opposite spacers
lockIconstring<span></span>HTML string for the lock icon
unlockIconstring<span></span>HTML string for the unlock icon

Example

Initialize with:

spacers({element:'.element-unique-class'});

Dependencies

Voila! It works without any dependencies.

License

Copyright (c) 2021 AkashLicensed under the MIT license.


[8]ページ先頭

©2009-2025 Movatter.jp