Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivanhoe-dev/Centify
Easy UI Alignment by Jquery
https://github.com/ivanhoe-dev/Centify
Last synced: about 1 month ago
JSON representation
Easy UI Alignment by Jquery
- Host: GitHub
- URL: https://github.com/ivanhoe-dev/Centify
- Owner: ivanhoe-dev
- Created: 2018-05-06T12:05:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-06T14:50:40.000Z (over 6 years ago)
- Last Synced: 2024-08-04T00:02:58.714Z (5 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-hk-open-source - Centify - Align HTML DOM的library,方便建立UI。[![GitHub stars](https://img.shields.io/github/stars/ivanhoe-dev/Centify.svg?style=social)](https://github.com/ivanhoe-dev/Centify/stargazers) (Javascript)
README
# Centify
## IntroductionCentify is a Jquery library for easy UI(DOM) alignment.
Align left? Align center? We handle all alignments for you!:smile_cat::clap:## Quick Start
1. Import Jquery in your HTML
2. Import "centify.js" in your HTML
``````
3. Initialize centify (Center everything):
```
$(function(){
$("#YourElementToAlign").centify();
});
```
4. Define your alignment criteria:
```
$("#YourElementToAlign).centify({
align_element_x:"right"
});
```
5. All applications of the library can be referred to demo.html## Documentation
Parameters:| Parameters | Usages | Default | Values |
| ------------- | ------------- | ------------- | ------------- |
| `align_element_x` | Align the DOM horizontally | center | left,right,center |
| `align_element_y` | Align the DOM vertically | center | top,center,bottom |
| `align_text_x` | Align the text horizontally | center | left,right,center |
| `align_text_y` | Align the text vertically | center | top,center,bottom |Multiple alignment:
Multiple selectors can share the same alignment rules
```
$("#YourElementToAlign,#YourElementToAlign2).centify({
align_element_x:"right",
align_element_y:"top",
});
```