Skip to content

Commit

Permalink
Documentation: Remove width/height attribute explanation because its …
Browse files Browse the repository at this point in the history
…misleading with proper img[alt] content.
  • Loading branch information
aFarkas committed Apr 11, 2019
1 parent 9ee88db commit db65cc5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,12 @@ This [attrchange / re-initialization extension](plugins/attrchange) automaticall
There are also other plugins/extension in the [plugins folder](plugins). As always you are open to create new ones for your project.

## <a name="specify-dimensions"></a>Tip: Specifying image dimensions (minimizing reflows and avoiding page jumps)
To minimize reflows, content jumping or unpredictable behavior with some other JS widgets (isotope, masonry, some sliders/carousels...) the width **and** the height of an image should be calculable by the browser before the image source itself is loaded. For "static" images this can be done using either CSS or using the content attributes:
To minimize reflows, content jumping or unpredictable behavior with some other JS widgets (isotope, masonry, some sliders/carousels...) the width **and** the height of an image should be calculable by the browser before the image source itself is loaded:

```html
<img

width="350"
height="150"
style="width: 350px; height: 150px;"
data-srcset="http://placehold.it/350x150 1x,
http://placehold.it/700x300 2x"
data-src="http://placehold.it/350x150"
Expand Down

0 comments on commit db65cc5

Please sign in to comment.