dom
domlight
npm i domlight
dom

domlight

Spotlight DOM elements easily

by Tom

0.1.1 (see all)License:MITTypeScript:Not Found
npm i domlight
Readme

domlight Build Status Version Gitter chat Stories in Ready

A lightweight and dependency-free micro library to easily spotlight DOM elements

domlight was originally based on Focusable, but it includes missing features such as multiple elements spotlight, several refactors and uses pure DOM API (no jQuery dependency)

Showcase

Installation

Install via Bower

bower install domlight

Install via Component

component install h2non/domlight

Install via npm

npm install domlight

Or loading the script remotely

<script src="//cdn.rawgit.com/h2non/domlight/0.1.1/domlight.js"></script>

Browser Support

ChromeFirefoxIEOperaSafari
+5+3.5+9+10+5

API

Set spotlight using jQuery/Zepto selector
Domlight($('#my-element'))
Set spotlight
Domlight(document.querySelector('#my-element'), options)
Hide spotlight
Domlight.hideAll()
Get focused DOM elements
Domlight.getActiveElements()
Get options
Domlight.getOptions()
Options
PropertyValueDefaultDescription
fadeDurationNumber700Duration of the overlay transition (milliseconds).
hideOnClickBooleanfalseHides the overlay when the user click into it.
hideOnESCBooleanfalseHides the overlay when the user press Esc.
findOnResizeBooleanfalseRefind the element in the DOM in case that the element don't still exists.

Development

Clone this repository and switch into it

git clone https://github.com/h2non/domlight && cd domlight

Install development dependencies

npm install

Run tests

make test

Run the example demo and open localhost:8000

make demo

Contributing

  1. Check open issues

  2. Fork it

  3. Create your feature branch (git checkout -b my-new-feature)

  4. Commit your changes (git commit -am 'feat(name): description')

  5. Push to the branch (git push origin my-new-feature)

  6. Create a new Pull Request

Authors

License

MIT (c) 2015 - Tomas Aparicio and contributors

Downloads/wk

9

GitHub Stars

13

LAST COMMIT

7yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.1.1
latest
7yrs ago
No alternatives found
No tutorials found
Add a tutorial