JavaScript image loading library Echo. js, javascriptecho. js

Source: Internet
Author: User

JavaScript image loading library Echo. js, javascriptecho. js

Echo is an independent JavaScript tool for loading images lazily. It is fast, small (less than 1 k), and uses HTML5 data-attributes. Echo supports IE8 +.

Plug-in description: like Lazy Load, Echo. js is also used for image delayed loading of JavaScript. The difference is that Lazy Load is a jQuery-based plug-in, while Echo. js is independent of jQuery or other JavaScript libraries and can be used independently. In addition, Echo. js is very small and less than 1 kb after compression.

Compatibility

Echo. js uses the date attribute of HTML5 and needs to obtain the value of this attribute. Therefore, it is not compatible with IE6 and IE7. Although Lazy Load also uses the date attribute of HTML5, the methods for obtaining values are different.

Usage

  1. Import files

Copy codeThe Code is as follows:
<Script src = "js/echo. min. js"> </script>

  2. HTML

Copy codeThe Code is as follows:

Blank.gif is a 1x1 image. It is used as the default image. The attribute value of data-echo is the real address of the image. Similarly, it is best to set the width and height for the image, or set it in CSS. Otherwise, it seems that the image at the very bottom will be delayed.

  3. JavaScript

Echo.init({offset: 0,throttle: 0}); 

Parameters

Parameters Description
Offset How many pixels can an image be loaded from the visible area?
Throttle How many milliseconds of image loading latency

The above content is for the JavaScript image delay loading library Echo. js, I hope to help you!

Articles you may be interested in:
  • Loading Baidu sharing code with JS latency to improve webpage speed
  • Implementation methods and ideas of js image delayed Loading
  • Move the mouse over js Code to implement delayed loading and hide Layers
  • Several Methods for loading JavaScript code with delay accelerate webpage access
  • How to Use the jquery plug-in lazyload. js to delay image loading
  • How to Use the Jquery. lazyload. js extension for jquery image delayed Loading
  • Analysis on js pre-loading/delayed Loading

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.