# picture_slider

> picture_slider formats a picture frame element > picture container element > image elements into a dynamic picture slider.

Latest version **1.0.3** (published 2022-04-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install picture_slider
pnpm add picture_slider
yarn add picture_slider
bun add picture_slider
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-04-30 |
| First published | 2022-04-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | nickslick03 |
| Maintainers | nickslick03 |
| Keywords | front-end, images |

## Links

- npm: https://www.npmjs.com/package/picture_slider
- Repository: https://github.com/nickslick03/picture_slider
- Homepage: https://github.com/nickslick03/picture_slider#readme
- Issues: https://github.com/nickslick03/picture_slider/issues
- npm.io page: https://npm.io/package/picture_slider

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2022-04-30
- 1.0.2 — 2022-04-29
- 1.0.1 — 2022-04-29
- 1.0.0 — 2022-04-29

## README

# picture_slider

**by nickslick03**

picture_slider formats a picture frame element > picture container element > image elements into a dynamic picture slider.

## Usage

**JS**:

```
let switchSlide = formatPictureSlider(pictureFrame, pictureContainer, height, heightUnit, autoSlideSeconds, maxHeight);
```

pictureFrame : HTML element - contains pictureContainer and images elements.

pictureContainer : HTML element - whose parent is pictureFrame; parent of image elements.

height : number - Represents the height of pictureFrame.

heightUnit : String - Represents the units height parameter is in; currently ``'px'`` and ``'vw'`` are supported.

autoSlideSeconds : number - (Optional) automatically slides pictureSlider to the right every ``autoSlideSeconds`` second.

maxHeight : number - (Optional) sets a maximum height limit on pictureFrame element in pixels.

return value : function - returns a function which takes a parameter of an index, and slides the images slider to the image corresponding to that index.

## Example

**HTML**:

```
<div id="pictureFrame">
	<div id="pictureContainer">
        <img src="./images/download.jpeg" alt=""><img src="./images/download (1).jpeg" alt=""><img src="./images/download (2).jpeg" alt=""><img src="./images/download (3).jpeg" alt="">
	</div>			
</div>
```

**JS**:

```
document.body.onload = () => { formatPictureSlider(document.getElementById('pictureFrame'), document.getElementById('pictureContainer'), 40, 'vw', 3, 400); };
```

**OUTPUT**:

![picture slider result gif](https://media.giphy.com/media/u0FjeyL9R3N5vEbC5i/giphy.gif)

**IMPORTANT**:

insure that ``formatPictureSlider`` is run after the document loads like in the example above using the ``onload`` event. ``formatPictureSlider`` will not work if it is ran before the images load into the document.

---
_Source: https://npm.io/package/picture_slider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
