Comments (12)
Nice, thanks.
from react-simple-img.
thanks @humbertqz will publish today! thank you for your testing
from react-simple-img.
v1.14.0 released, i will close the issue. feel free to re-open if you find other issues
from react-simple-img.
The div
is made for the placeholder animation, because you have the actual image and placeholder wrapped inside.
There are two solutions:
- provide img
width
andheight
and applyapplyAspectRatio
- i will have to create a minor version, by supply
placeholder
=false
, which will remove placeholder and the wrappingdiv
, plus you will lost the animation from the placeholder.
let me know.
from react-simple-img.
Maybe that could be a feature?
Remove everything but the img tag.
from react-simple-img.
sure i can looking into that over the weekend :) but you lost beautiful animation
from react-simple-img.
Could you please help on testing? [email protected]
you have to set placeholder={false}
from react-simple-img.
Yes!, but i never used a beta repo, how can i download it? I was using the component in a GatsbyJs project.
from react-simple-img.
just yarn add [email protected]
or npm i [email protected]
. i did testing with my own demo and it works, just want to double check with yours before publishing.
from react-simple-img.
Yes, it works this is my component:
<SimpleImg height={440} src={this.props.imgsrc} placeholder={false} />
This is what is rendered:
<img src="/static/thumb-plaza-cataluna-6106ec93376385a64fbf1cd99450ec09.jpg" srcset="" data-placeholder="false" data-src="/static/thumb-plaza-cataluna-6106ec93376385a64fbf1cd99450ec09.jpg" height="440" style="transition: all 0.3s ease 0s; opacity: 0; visibility: visible;">
Set the opacity: 0; by default, is there a way to change this?
from react-simple-img.
thanks for the testing! i forgot to set opacity back to 1 for the animation :(
try this version [email protected]
should only render and animate when finished loading
from react-simple-img.
It's working this is the rendered element:
<img src="/static/thumb-plaza-cataluna-6106ec93376385a64fbf1cd99450ec09.jpg" srcset="" data-placeholder="false" data-src="/static/thumb-plaza-cataluna-6106ec93376385a64fbf1cd99450ec09.jpg" data-end-style="opacity:0;" style="transition: all 0.3s ease 0s; opacity: 1; visibility: visible;">
from react-simple-img.
Related Issues (20)
- TypeError: placeholder.indexOf is not a function HOT 5
- Number.isNaN not supported in IE11 HOT 3
- Image can't be loaded on FireFox HOT 7
- Support for SEO (no script tag) HOT 9
- Inline CSS is stretching images HOT 14
- Image src not updated when component rerenders HOT 4
- Fallback/default img when img url is not valid HOT 7
- Wanting to turn off all class insertions HOT 5
- Add browser support to README HOT 9
- Using webp images with <picture> and multiple source sets? HOT 2
- Typescript types generated ? HOT 2
- disableAnimationAfterCache does not exist in source code HOT 1
- Height and width not accepting % HOT 1
- When Running Docker on LocalHost, Image Always Behind White Background HOT 2
- threshold doesn't take in account scrolling down HOT 5
- Invalid empty srcSet attribute in SSR HOT 6
- Placeholder does not have `alt` attribute HOT 2
- not showing img after re-rendering component HOT 1
- Images loaded over network twice with cache disabled HOT 4
- When Component Re-Renders with new src tag, image does not change. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-simple-img.