Skip to content

Download and Using egjs

Son Chan Uk edited this page Jul 27, 2017 · 26 revisions

Table of Contents

  1. How to download
  2. How to use

How to download

1. egjs Download

For latest version, check out
https://naver.github.io/egjs/latest/dist

Uncompressed (for development)

Compressed (for production)

Downloading egjs using Bower

egjs is registered as a package with Bower. You can install the latest version of egjs with the command.

# Intall bower (if not installed)
# install bower globally (admin account required)
$ npm install bower -g

# then intall egjs using bower
$ bower install egjs

Downloading egjs using NPM

egjs is registered as a package with NPM. You can install the latest version of egjs with the command.

# intall egjs using NPM
$ npm install egjs

2. Download dependency library

egjs has following dependencies.

|jQuery|hammer.js| |---|---|---| |1.7.0+ |2.0.4+|

  • Except jQuery, others are not mandatory. Required dependencies may differ according components.

jQuery

egjs requires jQuery library before using. For more information about jQuery download, please check following link.
http://jquery.com/download/

you can see following message when you didn't include jQuery library.

[egjs] The 1st argument of eg is missing.
Download jQuery from [http://jquery.com/].

hammerjs

eg.MovableCoord and eg.Flicking components require hammerjs library before using.

For more information about Hammerjs download, please check following link.
http://hammerjs.github.io/getting-started/

bower install hammer.js

you can see following message when you didn't include hammerjs library.

[egjs] The 3rd argument of movableCoord is missing.
Download Hammer from [http://hammerjs.github.io/].

Suppot IE8
hammerjs support IE9+ link
if you want to use hammer.js in IE8, you should include hammerjs-compatible before using
For more information about hammerjs-compatible, please check following link.
https://github.com/naver/hammerjs-compatible

How to use

1. Load dependency library before eg.js(or eg.min.js) load.

1) Load jQuery

<!-- jQuery -->
<script src="bower_components/jquery/jquery.js"></script>

2) Load hammer.js when you use eg.MovableCoord or eg.Flicking

<!-- hammerjs (When you use eg.MovableCoord or eg.Flicking) -->
<!--[if IE 8]>
<script type="text/javascript" src="hammerjs.compatible.js"></script>
<![endif]-->
<script src="bower_components/hammer.js/hammer.js"></script>

2. Load egjs

<script src="dist/eg.js"></script>