Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

后台返回参数一定要带图片宽度和高度吗? #38

Open
deepexpert-chenkai opened this issue Oct 13, 2017 · 1 comment
Open

Comments

@deepexpert-chenkai
Copy link

我现在后台只传了图片url过来,前端写死每个图片的宽度,高度根据图片情况自适应。
现在有一个问题就是图片还没加载完成的时候,页面已经渲染了div的宽高,等到图片加载完,布局已经没法改变了,出现图片重叠的情况。
问:有没有办法不传高度宽度情况下解决这个问题?

@huamurui
Copy link

可以但是很麻烦...

你可以自己写个中间层等图片 onload 完了再把宽高拿出来塞进布局。

https://juejin.cn/post/6844903728244342792

https://github.com/nodeca/probe-image-size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants