사이트 내 전체검색
Preload images with jQuery Preload plugin
로빈아빠
https://cmd.kr/javascript/815 URL이 복사되었습니다.

본문

 

A jQuery plugin that preloads images

jQuery Preload plugin logo

Description

There are times that we need to preload images to bring better user experience. You will not want your users to wait for 2 seconds when they hover their mouse over the navigation menu before the background image actually appears; or keep them waiting too long when they switch a slideshow. This plugin can also be useful when you want to add more images on the page through a ajax call.

Demo

  • Click here to see the demo
  • The demo page is also included in the source file

Download

  • Download source code from Github

Requires

  • jQuery 1.2.3+

Browser Compatibility


Installation

  • First, make sure you are using valid DOCTYPE
  • Include nessesary JS files
1
2
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="path-to-file/jquery.preload.js"></script>

Usage

Example code:
1
2
3
4
5
$.preload( '/img/space.gif',
  '/img/loading.gif',

댓글목록

등록된 댓글이 없습니다.

831 (1/17P)

Search

Copyright © Cmd 명령어 18.217.252.194