When using Picturefill 2 I'm getting layout jumping on images while the page is loading, for example, when you don't specify height on a normal image. Is this expected with Picturefill and is there a way around this problem? Thanks.
Picturefill 2 IMG height jumps on page load
167 Views Asked by user3296711 At
1
There are 1 best solutions below
Related Questions in IMAGE
- Add image to JCheckBoxMenuItem
- Display images on Django Template Site
- How to resize images with PHP PARSE SDK
- Animation in Java on top of JPanel
- Slow performance on ipad erasing image
- What are the pros and cons of the picture element?
- Carrierwave file upload with different file types
- How to use annotorious with angular
- Images not showing when uploaded to server
- ImageView doesn't show up
- Image Resizing adjusts ratio
- Displaying bitmap image on Android (OpenCV)
- Class 'Imagick' not found - PHP and Windows
- Image position - randomly select position
- Replace image 1 with image 2 after 5 sec
Related Questions in HEIGHT
- Get height of element then add class/change css
- input height different in ios
- Jquery Tumblr Each() Solution?
- calculating UIWebView height with images gives wrong answer
- Making 3 columns of text aligned at the same height or line all the time even while re sizing window
- Using the height() method in jquery
- CSS: How to prevent div from overlapping parent height or parent border
- Incorrect UITableViewCell height UIImageView
- Height of left and right sides are uneven - CSS
- Defining percentual height for div (CSS) with Google Maps element
- get height of dom element after using get(index)
- Javascript Image() object erroneously setting height and width to 0 sometimes
- Set minimum expandable height to List View cell Android
- Div with a simple variable height
- how to fit content in browse height
Related Questions in PAGELOAD
- Run script on page load
- Implementing loading div in a php page not working
- Set session-state Cookiemode property for click event?
- In an ASP.NET web form, how to determine what causes a Page_Load()
- how to handle 1000+ images in one web page?
- On document ready get cities by country id not working [ jquery custom plugin ]
- pageLoad function in page and masterpage
- JQM 1.4.3 refresh submenu panel after AJAX load
- how to dropdown option keep selected after page loads onchange
- How to stop selenium webdriver from waiting for page load?
- ASP.NET listbox selectedValue in PageLoad
- How to call a function when a page loads in Javascript with Jquery
- Set element ID on page load with Jquery?
- clarification on when does ajax call within document.ready gets triggered
- Page_Init and Page_Load executes twice ASP & VB.NET only in IE .. why?
Related Questions in PICTUREFILL
- Changing img based on window size
- jQuery load not always firing with <picture> element in Chrome
- Mixing srcset and picture for responsive images
- img srcset - disregard pixel density
- Is there a way to combine the lazyload js library with Picturefill?
- Use of picture element as a container instead of a div
- Select rendered picture element image in chrome
- Detect "image corrupt or truncated" in Firefox
- How to change picture element srcset value with jQuery
- Picture srcset and isotope grids that change image width on click not viewport
- How to use Picturefill
- Do <picture> HTML sources make several server requests or just one?
- How to use fallback on picture tag - Safari Webp
- In picturefill.js, how to write other than the above specified?
- PictureFill - showing no image on mobile devices
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The problem you are describing isn't necessarily limited to Picturefill. To avoid this issue you can calculate the ratio of the image’s height to its width. Even with loading images for a responsive site, though you may not know the image dimensions because of screen size, this ratio will be the same. For example, for a height of 200px and width of 300px:
Create a container div around the Picturefill element(s)
And use the following CSS
That should work. Check out this blog post and this CodePen example for more info.
EDIT
This method doesn't work if the ratios of the image widths and heights are different for responsive image loading. I just ran into this situation so just a heads up.