๐Ÿ”” Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Created to implement the Progress page loading easier.Load the image for obtaining the speed check internet speed.Progress must implement a page to load , based on the amount of that speed.

Plugins

Documentation

#jquery.nPageLoader

/**  * @PluginName	jquery.nPageLoader.js  * @Requires	jQuery v1.0.4 ~ v1.10.2  * @Author		nonoll ( http://usefl.co.kr - hyunkwan Roh )  * @Version		1.0.0  * @Date		2014.01.22  */

ํŽ˜์ด์ง€ ๋กœ๋”ฉ ํ”„๋กœ๊ทธ๋ž˜์Šค๋ฅผ ์‰ฝ๊ฒŒ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“ฆ.

์†๋„ ์ฒดํฌ์šฉ ์ด๋ฏธ์ง€๋ฅผ ๋กœ๋“œํ•˜์—ฌ ์ธํ„ฐ๋„ท์†๋„๋ฅผ ๊ตฌํ•˜๊ณ 

๊ทธ ์†๋„๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ•˜์—ฌ ๋กœ๋“œํ•  ํŽ˜์ด์ง€์–‘์— ํ”„๋กœ๊ทธ๋ž˜์Šค๋ฅผ ๊ตฌํ˜„ํ•จ.

#Setup jquery v1.x ์™€ jquery.nPageLoader.js ๋ฅผ ์›นํŽ˜์ด์ง€์— ์ถ”๊ฐ€

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script src="js/jquery.nPageLoader.js"></script>

#Methods

  • init : ์‹คํ–‰
  • addEventListener : ์ด๋ฒคํŠธ๋ฆฌ์Šค๋„ˆ ๋“ฑ๋ก
  • event - progress : event ์ด๋ฒคํŠธํƒ€์ž… , byteLoaded ๋กœ๋“œ๋œ byte , byteTotal ๋กœ๋“œํ•  ์ด byte , percent ๋กœ๋“œ๋œ ํผ์„ผํŠธ
  • event - complete : event ์ด๋ฒคํŠธํƒ€์ž… , percent ๋กœ๋“œ๋œ ํผ์„ผํŠธ
// ์‹คํ–‰ $.nPageLoader.init();  // ์ด๋ฒคํŠธ ์ฒดํฌ $.nPageLoader.addEventListener( "event", listener ); /*   event > "progress"               event       : ์ด๋ฒคํŠธ ํƒ€์ž…               byteLoaded  : ๋กœ๋“œ๋œ byte               byteTotal   : ๋กœ๋“œํ•  ์ด byte               percent     : ๋กœ๋“œ๋œ ํผ์„ผํŠธ         > "complete"               event       : ์ด๋ฒคํŠธ ํƒ€์ž…               percent     : ๋กœ๋“œ๋œ ํผ์„ผํŠธ */

#Usage 1. ๊ธฐ๋ณธ ์‚ฌ์šฉ

$.nPageLoader ๋ฅผ ์„ ์–ธ ์‹คํ–‰ํ•˜๊ณ 

addEventListener ๋ฅผ ์ด์šฉ ์ด๋ฒคํŠธ๋ฅผ ์ฒดํฌํ•œ๋‹ค

var pageLoader = $.nPageLoader; pageLoader.init({ 	// ์†๋„์ฒดํฌ์šฉ ์ด๋ฏธ์ง€ url 	url : "http://www.google.com/images/srpr/nav_logo14.png", 	// ์†๋„์ฒดํฌ์šฉ ์ด๋ฏธ์ง€ ์šฉ๋Ÿ‰ kb 	urlSize : 28.6, 	// ์‹ค์ œ ๋ฌธ์„œ ์˜ˆ์ƒ ์šฉ๋Ÿ‰ kb 	size : 155, 	// console log 	log : true }); pageLoader.addEventListener( "progress", onProgress ); pageLoader.addEventListener( "complete", onComplete );  function onProgress( e ){ 	$("#pageLoader_status").html(e.percent + "%"); 	$("#pageLoader_bar").width(e.percent + "%"); }  function onComplete( e ){ 	$("#pageLoader_status").html(e.event); 	$("#pageLoader_bar").css("background-color","blue"); }

2. ๊ธฐ๋ณธ ์˜ต์…˜

$.nPageLoader.defaults = { 		// ์†๋„์ฒดํฌ์šฉ ์ด๋ฏธ์ง€ url 		url: "http://www.google.com/images/srpr/nav_logo14.png", 		// ์†๋„์ฒดํฌ์šฉ ์ด๋ฏธ์ง€ ์šฉ๋Ÿ‰ kb 		urlSize: 28.6, 		// ์‹ค์ œ ๋ฌธ์„œ ์˜ˆ์ƒ ์šฉ๋Ÿ‰ kb 		size: 155, 		// kb ๋‹จ์œ„ ์‚ฌ์šฉ 		kb: true, 		// ์บ์‹œ ์‚ฌ์šฉ 		noCache: true, 		// console log 		log: false 	};

##History

  1. 2014.01.23 ์ฒซ ๋ฒ„์ „ ๋“ฑ๋ก
  2. 2014.04.14 ์˜ค๋ฅ˜ ์ˆ˜์ • ๋“ฑ๋ก

You May Also Like