Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sean-hill/elemental-window

Helper functions for jQuery to get the length from the edge of an element to the edge of the window.
https://github.com/sean-hill/elemental-window

Last synced: 20 days ago
JSON representation

Helper functions for jQuery to get the length from the edge of an element to the edge of the window.

Awesome Lists containing this project

README

        

# elemental-window

## Description:
elemental-window is a simple jQuery plugin to help find the length from the edge of an element to the edge of the window.
It basically expands on jQuery's .offset() function by adding on the properties .right and .bottom.

## Usage:
1. Insert the necessary elements in your document's `` section, e.g.:

Remember to include jquery.elemental-window.js *after* including the main jQuery library.

2. Initialise elemental-window in your document.onload, e.g.:


$(document).ready(function() {
var edges $('#element').windowOffsets();
var top = edges.top;
var right = edges.right;
var bottom = edges.bottom;
var left = edges.left;
});