Namespace: eg

eg

Classes

Class
Component
Flicking
InfiniteGrid
MovableCoord
Visible

Members

staticeg.VERSION

The version numbers of egjs.

egjs 버전

Methods

agent(){Object}

Returns the User-Agent information

user-agent 정보를 반환한다.

Returns:
Name Type Description
agent Object
Name Type Description
os Object
os Operating system information

운영체제 정보

Name Type Description
name String
Operating system name (android, ios, window, mac)

운영체제 이름 (android, ios, window, mac)

version String
Operating system version

운영체제 버전

browser String
Browser information

브라우저 정보

Name Type Description
name String
Browser name (default, safari, chrome, sbrowser, ie, firefox)

브라우저 이름 (default, safari, chrome, sbrowser, ie, firefox)

version String
Browser version

브라우저 버전

webview String
Indicates whether a WebView browser is available

웹뷰 브라우저 여부

Example

eg.agent(); // { // os : { // name : "ios", // version : "8.2" // }, // browser : { // name : "safari", // version : "8.2" // nativeVersion : "-1" // } // } eg.hook.agent = function(agent) { if(agent.os.name === "naver") { agent.browser.name = "inapp"; return agent; } }

cancelAnimationFrame(key)

A polyfill for the window.cancelAnimationFrame() method. It cancels an animation executed through a call to the requestAnimationFrame() method.

window.cancelAnimationFrame() 메서드의 polyfill 함수다. requestAnimationFrame() 메서드로 실행한 애니메이션을 중단한다

  • key
    Type: Number

    − The ID value returned through a call to the requestAnimationFrame() method.

    requestAnimationFrame() 메서드가 반환한 아이디 값

Example
    eg.cancelAnimationFrame(timerId);
See:

isHWAccelerable(){Boolean}

Checks whether hardware acceleration is enabled.

하드웨어 가속을 사용할 수 있는 환경인지 확인한다

Returns:
Type Description
Boolean
Indicates whether hardware acceleration is enabled.

하드웨어 가속 사용 가능 여부

Example

eg.isHWAccelerable(); // Returns 'true' when hardware acceleration is supported

// also, you can control return value eg.hook.isHWAccelerable = function(defalutVal,agent) { if(agent.os.name === "ios") { // if os is 'ios', return value is 'false' return false; } else if(agent.browser.name === "chrome" ) { // if browser is 'chrome', return value is 'true' return true; } return defaultVal; }

isPortrait(){Boolean}

Checks whether the current orientation of the device is portrait.

기기의 화면이 수직 방향인지 확인한다

Returns:
Type Description
Boolean
The orientation of the device (true: portrait, false: landscape)

기기의 화면 방향(true: 수직 방향, false: 수평 방향)

Example

eg.isPortrait(); // Check if device is in portrait mode

isTransitional(){Boolean}

Checks whether CSS transition properties can be used.

CSS 트랜지션 속성을 사용할 수 있는 환경인지 확인한다.

Returns:
Type Description
Boolean
Indicates whether CSS transition properties can be used.

CSS 트랜지션 속성 사용 가능 여부

Example

eg.isTransitional(); // Returns 'true' when CSS transition is supported.

// also, you can control return value eg.hook.isTransitional = function(defaultVal, agent) { if(agent.os.name === "ios") { // if os is 'ios', return value is 'false' return false; } else if(agent.browser.name === "chrome" ) { // if browser is 'chrome', return value is 'true' return true; } return defaultVal; }

requestAnimationFrame(timer){Number}

A polyfill for the window.requestAnimationFrame() method.

window.requestAnimationFrame() 메서드의 polyfill 함수다

  • timer
    Type: function

    The function returned through a call to the requestAnimationFrame() method

    requestAnimationFrame() 메서드가 호출할 함수

Returns:
Type Description
Number
ID of the requestAnimationFrame() method.

requestAnimationFrame() 메서드의 아이디

Example
    var timerId = eg.requestAnimationFrame(function() {
        console.log("call");
    });
See:

translate(x, y, isHA){String}

Returns the syntax of the translate style which is applied to CSS transition properties.

CSS 트랜지션 속성에 적용할 translate 스타일 구문을 반환한다

  • x
    Type: String

    Distance to move along the X axis

    x축을 따라 이동할 거리

  • y
    Type: String

    Distance to move along the Y axis

    y축을 따라 이동할 거리

  • isHA optional
    Type: Boolean

    Force hardware acceleration

    하드웨어 가속 사용 여부

Returns:
Type Description
String
Syntax of the translate style

translate 스타일 구문

Example

eg.translate('10px', '200%'); // translate(10px,200%); eg.translate('10px', '200%', true); // translate3d(10px,200%,0);

comments powered by Disqus