Class: Helper

SDI.LIBRARY.Helper

new Helper()

All the other things

In This class are all the little and big functions for an easier Life.
Version:
  • 0.0.1
Since:
  • 07.09.2017
Author:
  • e.best
Source:

Methods

(static) browserDetection()

Easy Browser Detection

wit this function you can simply check witch Browser is used
Source:
Returns:
Array [Browser] [Version]
Example
helper = new SDI.LIBRARY.Helper;
 navigator.sayswho = helper.browserDetection;
 if((navigator.sayswho[0] === "Firefox")||((navigator.sayswho[0] === "Chrome")&&(parseInt(navigator.sayswho[1])>=44))||(navigator.sayswho[0] === "Safari")){
 console.log(navigator);
 }

(static) clippingRect(bh, bw, ch, cw, dir) → {String}

Simple clipping

with this function we can simple set a clipping by the collapse height and width of an Element
Parameters:
Name Type Description
bh Number BannerHeight
bw Number BannerWidth
ch Number collapsed BannerHeight
cw Number collapsed BannerWidth
dir String Direction
Source:
Returns:
rect(top,left,bottom,right);
Type
String
Example
helper = new SDI.LIBRARY.Helper;
 document.getElementById('banner').style.clip = (helper.clippingRect(180,728,90,728,'top'));

(static) collision(div1, div2) → {number}

Collision recognizer

with this function we can check if an object collide with an other
Parameters:
Name Type Description
div1 object ein Node Opject
div2 object ein Node Opject
Source:
Returns:
Type
number
Example
helper = new SDI.LIBRARY.Helper;
 if(helper.collision(div1,div2)){console.log('Collision');}

(static) createCounter(SDGCounter)

Create a Counter

Creates a Counter image in the used document object.
Parameters:
Name Type Description
SDGCounter
Source:

(static) getDimAndPos(div) → {array|*}

Get dimension and position

Get the dimensions and absolute position aof an Element
Parameters:
Name Type Description
div
Source:
Returns:
Type
array | *

(static) getParent() → {Object}

Get information of the parent window

Get the Name, Object and container of the parent Window
Source:
Returns:
Type
Object

(static) getPos(el)

Get Element position

Get the absolute position of an Element
Parameters:
Name Type Description
el
Source:

(static) searchDivByClass(classname, tagname) → {*}

Search Div by classname

Search a Container by his CSS class name
Parameters:
Name Type Description
classname
tagname
Source:
Returns:
Type
*

(static) setStyle(style) → {*}

Create a Style

Creates a style Block
Parameters:
Name Type Description
style
Source:
Returns:
Type
*