Skip to content

Commit

Permalink
minor docs upd
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov committed Jul 23, 2015
1 parent f5212ff commit 70a46f9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Build Status](https://travis-ci.org/dimsemenov/PhotoSwipe.svg)](https://travis-ci.org/dimsemenov/PhotoSwipe)
[![devDependency Status](https://david-dm.org/dimsemenov/PhotoSwipe/dev-status.svg)](https://david-dm.org/dimsemenov/PhotoSwipe#info=devDependencies)
[![Donate](https://img.shields.io/gratipay/dimsemenov.svg?style=flat)](https://gratipay.com/dimsemenov/)
[![Flattr](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/3698358/dimsemenovPhotoSwipe-on-GitHub)

JavaScript image gallery for mobile and desktop.
Expand Down
15 changes: 8 additions & 7 deletions website/documentation/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ markdownpage: true
Use another gallery script ([1](http://dimsemenov.com/plugins/magnific-popup/), [2](http://dimsemenov.com/plugins/royal-slider/gallery/)), or find a way:

- You can read size of an image by downloading only small part of it ([PHP version](http://stackoverflow.com/questions/4635936/super-fast-getimagesize-in-php), [Ruby](https://github.com/sdsykes/fastimage), [Node.js](http://stackoverflow.com/a/20111234/331460)).
- You can store size of an image directly in its filename and parse it on frontend during PhotoSwipe initialization.
- You can store size of an image directly in its filename and parse it on frontend during PhotoSwipe initialization (`gettingData` event in API section).
- Most CMS store size of an image in a database and have API to retrieve it.
- Most web API (Facebook, 500px, Instagram, Flickr, Twitter, YouTube, Vimeo etc.) return a size of images.

Expand All @@ -34,8 +34,10 @@ Dimensions are used for progressive loading, stretched placeholder, initial zoom

### <a name="different-thumbnail-dimensions"></a> My thumbnails are square, but large images have different dimensions, what to do with opening/closing transition?

- Option 1: set option `showHideOpacity:true`, and opacity will be applied to the main image, not just to the background.
- Option 2: disable transition entirely (options `showAnimationDuration` and `hideAnimationDuration`).
1. If thumbnail aspect ratio does not match large image, do not define `msrc` property for slide objects and enable opacity transition option (`showHideOpacity:true, getThumbBoundsFn:false`).
2. If aspect ratio of thumbnail image file matches large image, **but thumbnail area is cropped via CSS**, just add `showHideOpacity:true` and make sure that `getThumbBoundsFn` option returns coordinates that consider crop area.

I strongly recommend to display thumbnails that match aspect ratio of large image, or crop the visible area via CSS (2).

I'll try to explain why this is not implemented yet. There are two ways to make expanding area animation:

Expand Down Expand Up @@ -149,6 +151,8 @@ So [serve responsive images](responsive-images.html), or at least don't serve hu

In much more rare cases crash can occur if you open PhotoSwipe during some process on your page (this can be initial page load/render, or some complex animation on page), try to delay PhotoSwipe initialization until page is rendered (18-300ms after document.ready), especially if you are displaying large images.

**UPD.:** in [v4.1.0](https://github.com/dimsemenov/PhotoSwipe/releases/tag/v4.1.0) this is partly fixed.

## Miscellaneous

### <a name="keep-updated"></a> Where is the changelog, how to do I get notified about updates?
Expand All @@ -158,12 +162,9 @@ Releases page has an [Atom feed](https://github.com/dimsemenov/PhotoSwipe/releas

Also, you may join my [email newsletter](http://dimsemenov.com/subscribe.html?i=pswp) (sent 3-4 times a year), follow [@PhotoSwipe on Twitter](http://twitter.com/photoswipe), and star/watch [PhotoSwipe on GitHub](https://github.com/dimsemenov/PhotoSwipe/).

It's very important to keep PhotoSwipe updated, especially during the beta period.


### <a name="wordpress-release"></a> When WordPress plugin will be released?

Plugin is under development and will be released in early-mid 2015. You may [subscribe here](http://dimsemenov.com/subscribe.html?i=pswp-wp) to get notified.
Plugin is under development and will be released in 2015. To get notified [subscribe to my newsletter](http://dimsemenov.com/subscribe.html?i=pswp-wp).


### <a name="can-i-use-in-theme"></a> I want to use PhotoSwipe in WordPress/Magento/Joomla... template, can I?
Expand Down
8 changes: 4 additions & 4 deletions website/documentation/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ markdownpage: true

First things that you should know before you start:

- PhotoSwipe is made simple and fast for end users, not for developers. It ain't simple jQuery plugin, at least basic JavaScript knowledge is required to install.
- PhotoSwipe requires predefined image dimensions. If your app is unable to retrieve them - consider using some other script. [More about this](faq.html#image-size).
- PhotoSwipe is not a simple jQuery plugin, at least basic JavaScript knowledge is required to install.
- PhotoSwipe requires predefined image dimensions ([more about this](faq.html#image-size)).
- If you use PhotoSwipe on non-responsive website &ndash; controls will be scaled on mobile (as the whole page is scaled). So you'll need to implement custom controls (e.g. single large close button in top right corner).
- All code in the documentation is pure Vanilla JS and supports IE 8 and above. If your website or app uses some JavaScript framework (like jQuery or MooTools) or you don't need to support old browsers – feel free to simplify the code.
- Avoid serving big images (larger than 2000x1500px) for mobile, as they will dramatically reduce animation performance and can cause crash (especially on iOS Safari). Possible solutions: [serve responsive images](responsive-images.html), or open image on a separate page, or use libraries that support image tiling (like [Leaflet](http://leafletjs.com/)). [More info in FAQ](faq.html#mobile-crash).
- Avoid serving big images (larger than 2000x1500px) for mobile, as they will dramatically reduce animation performance and can cause crash (especially on iOS Safari). Possible solutions: [serve responsive images](responsive-images.html), or open image on a separate page, or use libraries that support image tiling (like [Leaflet](http://leafletjs.com/)) ([more in FAQ](faq.html#mobile-crash)).

## <a name="initialization"></a> Initialization

Expand Down Expand Up @@ -515,7 +515,7 @@ Tip: you may download example from CodePen to play with it locally (`Edit on Cod

## About

PhotoSwipe is in beta, please [keep script updated](faq.html#keep-updated), report bugs through [GitHub](https://github.com/dimsemenov/PhotoSwipe), suggest features on [UserVoice](https://photoswipe.uservoice.com/forums/275302-feature-requests-ideas) and ask questions through [StackOverflow](http://stackoverflow.com/questions/ask?tags=javascript,photoswipe).
Please [keep script updated](faq.html#keep-updated), report bugs through [GitHub](https://github.com/dimsemenov/PhotoSwipe), suggest features on [UserVoice](https://photoswipe.uservoice.com/forums/275302-feature-requests-ideas) and ask questions through [StackOverflow](http://stackoverflow.com/questions/ask?tags=javascript,photoswipe).

Know how this page can be improved? Found a typo? [Suggest an edit!](https://github.com/dimsemenov/PhotoSwipe/blob/master/website/documentation/getting-started.md)

Expand Down
1 change: 0 additions & 1 deletion website/documentation/seo.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ In all above cases, `large-image.jpg` will be perfectly indexed. The caption ele


- Keep `alt` attribute short and descriptive. Leave long description for caption element.
- Twitter has a [Gallery Card](https://dev.twitter.com/cards/types/gallery), which allows you to display up to 4 images of gallery when page is shared via Twitter.
- [Google image publishing guidelines](https://support.google.com/webmasters/answer/114016).
- Use [Google](https://developers.google.com/webmasters/structured-data/testing-tool/) or [Yandex](https://webmaster.yandex.com/microtest.xml) structured data testing tool to validate your Schema.org markup.
- High-resolution images rank better, usually 1680px on a wider side is more than enough.
Expand Down

0 comments on commit 70a46f9

Please sign in to comment.