The Official Blog of Patcoola

Im just a dude watching over my parents,
and trying to make cartoons and video games from home.

Script: Z Index [JS API]

Important!

Dear visitors,

This blog and the Tigarus.com network will be changing our website software in May (2024). There will be some down time and there will be a change to the webpage addresses.

We will also be removing the Anime blogs. The Rocksmith Songs website will be unavailable of a few weeks or months while I move the database to the new software.

At the moment we are running on Wordpress, the new software is an in-house project which is 57 times faster. It will also provide more freedom for development.

Thank you for understanding.

, By Patcoola

Script Title: zIndex
Programming Language: Java Script
Date Completed: 2013/05/01

Purpose: Provides a method of managing element depth.

Advertisement

Donate Now!

This might not be the best time, but making a blog is not easy. Would you consider donating?


Description: Manages the z-index of elements. Elements are targeted by element ID and are added to an index registry to cache the z-index value of the element instead of getting the computed z-index every time which is slow and inefficient.

Methods:

zIndex.getComputedById ( id );

Returns the computed z-index value of an element ID.

zIndex.setDefaultById ( id, zIndex );

Set the default z-index “Fall back” value for element ID. Adds index to registry.

zIndex.getDefaultById ( id );

Returns the set default z-index. Returns undefined if element ID has not be added to the index registry.

zIndex.setById ( id, zIndex );

Set the z-index of element ID, takes a number or value of default, auto or inherit.
If default index has not been set, the default “Fall back” index will be the current computed z-index before the defined index is set and added to index registry.

zIndex.getById ( id );

Returns the z-index of element ID. Returns undefined if element ID has not be added to the index registry.

zIndex.toggleById ( id, byIndex, withIndex );

Changes the z-index of element ID by an index with another index value. Often used to toggle the default index value with a given index.

zIndex.swapByIds ( byId, withId, [computed_b] );

Swaps the indexes of element ID with another element ID.
Optional argument computed_b default value false. If set to true, the index will be updated with the computed z-index. Note: If an element is not in the index registry, it will be added, the default and set index will be the computed index.

zIndex.removeId ( id );

Removes an entry from the index registry.

Zindex.empty();

Clears the index registry. Removes all entries.

Z-Index can be a number or default, auto or inherit.

 

Advertisement

Donate Now!

Hi there, I spend a lot of time making this blog.

It would be great if you would consider donating.


 

Post Meta

Share Post

 

Comments: Write Comment

Be the first to write a comment.


Leave a Comment


All comments are reviewed before publishing. Comments must be related to the page topic, must not be spam, and must comply with the criminal code of Canada.