Skip to content

Commit

Permalink
Merge pull request #1118 from marekdedic/default-option-change
Browse files Browse the repository at this point in the history
Updated default options
  • Loading branch information
marekdedic authored Oct 6, 2024
2 parents f42e1eb + e6b9195 commit 7a5522f
Show file tree
Hide file tree
Showing 12 changed files with 234 additions and 312 deletions.
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,24 @@ If you prefer to use jQuery, there are also jQuery versions available in `dist/i

You can pass an object with options to the `ImageLightbox` constructor as a second argument. The available options are:

| Option | Type | Default value | Description |
| ---------------- | --------- | --------------------- | --- |
| `activity` | `boolean` | `false` | Whether to show an activity indicator when loading or changing the images |
| `allowedTypes` | `string` | `png\|jpg\|jpeg\|gif` | A list of allowed file types. Use an empty string to allow any type. |
| `animationSpeed` | `number` | `250` | The duration (in milliseconds) of all animations |
| `arrows` | `boolean` | `false` | Whether to show navigation arrows |
| `button` | `boolean` | `false` | Whether to show a close button |
| `caption` | `boolean` | `false` | Whether to show image captions, if they are available |
| `enableKeyboard` | `boolean` | `true` | Whether to enable keyboard navigation (previous/next with arrows, Escape to exit) |
| `history` | `boolean` | `false` | Whether to save the current lightbox state to the browser history and add perma-linkable URLs |
| `fullscreen` | `boolean` | `false` | Whether to enable the availability to show the lightbox in fullscreen mode |
| `gutter` | `number` | `10` | The minimum amount of free space (in % relative to the window size) to always keep around the image |
| `navigation` | `boolean` | `false` | Whether to show a navigation (panel with clickable dots for each image) |
| `overlay` | `boolean` | `false` | Whether to show a dark page overlay under the image |
| `preloadNext` | `boolean` | `true` | Whether to start preloading the next image upon navigation |
| `quitOnEnd` | `boolean` | `false` | Whether to close the lightbox when navigation past the last image. Alternatively, the lightbox just loops to the first image. |
| `quitOnImgClick` | `boolean` | `false` | Whether to close the lightbox when the image is clicked. Alternatively, the previous/next image is shown based on the position of the click. Never quits on touch devices. |
| `quitOnDocClick` | `boolean` | `true` | Whether to close the lightbox when clicking outside of the image. |
| `quitOnEscKey` | `boolean` | `true` | Whether to close the lightbox when the Escape key is pressed. Requires the `enableKeyboard` option to be `true`. |
| Option | Type | Default value | Description |
| ---------------- | --------- | ------------- | --- |
| `activity` | `boolean` | `true` | Whether to show an activity indicator when loading or changing the images |
| `allowedTypes` | `string` | `""` | A list of allowed file types. Use an empty string to allow any type. |
| `animationSpeed` | `number` | `250` | The duration (in milliseconds) of all animations |
| `arrows` | `boolean` | `true` | Whether to show navigation arrows |
| `button` | `boolean` | `true` | Whether to show a close button |
| `caption` | `boolean` | `false` | Whether to show image captions, if they are available |
| `enableKeyboard` | `boolean` | `true` | Whether to enable keyboard navigation (previous/next with arrows, Escape to exit) |
| `history` | `boolean` | `false` | Whether to save the current lightbox state to the browser history and add perma-linkable URLs |
| `fullscreen` | `boolean` | `true` | Whether to enable the availability to show the lightbox in fullscreen mode |
| `gutter` | `number` | `10` | The minimum amount of free space (in % relative to the window size) to always keep around the image |
| `navigation` | `boolean` | `false` | Whether to show a navigation (panel with clickable dots for each image) |
| `overlay` | `boolean` | `true` | Whether to show a dark page overlay under the image |
| `preloadNext` | `boolean` | `true` | Whether to start preloading the next image upon navigation |
| `quitOnEnd` | `boolean` | `true` | Whether to close the lightbox when navigation past the last image. Alternatively, the lightbox just loops to the first image. |
| `quitOnImgClick` | `boolean` | `false` | Whether to close the lightbox when the image is clicked. Alternatively, the previous/next image is shown based on the position of the click. Never quits on touch devices. |
| `quitOnDocClick` | `boolean` | `true` | Whether to close the lightbox when clicking outside of the image. |

## Opening the lightbox with a JavaScript call

Expand Down
9 changes: 9 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ header h2 {
margin-bottom: 0.625em;
}

#main_content h2:first-child {
border-top: none;
}

p {
margin-bottom: 20px;
}
Expand All @@ -240,6 +244,11 @@ ul li {
margin: 0.625em;
}

#main_content section {
border-top: 1px solid #999;
padding-bottom: 20px;
}

footer {
padding-bottom: 30px;
background: transparent url("../images/hr.png") 0 0 no-repeat;
Expand Down
Loading

0 comments on commit 7a5522f

Please sign in to comment.