open-index/open-npm huggingface dataset:
npm package: 32ae08ef
Description: Snippets written in JavaScript. Majorly for our website. 
Author: ISAB Dev Team
Latest version: 0.1.20
Deprecated: Moved to isplib

# 32ae08ef

[![NPM](https://img.shields.io/npm/v/32ae08ef.svg)](https://www.npmjs.com/package/32ae08ef)
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/32ae08ef/badge)](https://www.jsdelivr.com/package/npm/32ae08ef)

> **Depreciated**: We have moved to [isplib](https://www.npmjs.com/package/isplib), and this package is no longer maintained.  
> The package itself is under CC0 license, but please note that some of the works cited therein have non-commercial restrictions.  
> Use it at your own risk. If necessary, you should consult a lawyer.  

## loadBackground

### Abstract

Awesome background images for web pages.

### Usage

> It is recommended that you replace `latest` with a fixed version name to prevent your pages being interfered by breaking changes.

You can load the file (minified by default) from `jsDelivr`

```html
<script async src="https://cdn.jsdelivr.net/npm/32ae08ef@latest/loadBackground.js"></script>
```

or `UNPKG`

```html
<script async src="https://unpkg.com/32ae08ef@latest/loadBackground.js"></script>
```

There are even more choices in China, but the speed and reliability cannot be guaranteed, and they may deliver outdated files.

`知乎`

```html
<script async src="https://unpkg.zhimg.com/32ae08ef@latest/loadBackground.js"></script>
```

`饿了么`

```html
<script async src="https://npm.elemecdn.com/32ae08ef@latest/loadBackground.js"></script>
```

### New Feature

Now You can assign to `window._imgPlace` to customize where to load the background image, which will be displayed behind `document.body` by default.

```js
const imgPlace = document.getElementById('example');
window._imgPlace = imgPlace;

const divName = 'example';
window._imgPlace = imgPlace;
```

### Compatibility

This file is expected to work well with the latest version of `Chrome` / `Firefox`. If not, please contact us.

### Technical Details

We are using dynamic `import()` to load subscriptscript.

> See also: [import - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)

As the CacheStorage API is only available with a security context, we provide a file `withoutCache.js` for users without secure connection.

> See also: [CacheStorage - Web APIs | MDN](https://developer.mozilla.org/zh-CN/docs/Web/API/CacheStorage)