Is it possible to parallax an img tag rather than background image in a div?

大城市里の小女人 提交于 2019-12-04 03:07:24

问题


I've come across a number of parallaxing tutorials (this one in particular I'm looking at now: http://net.tutsplus.com/tutorials/html-css-techniques/simple-parallax-scrolling-technique/); however, they all seem to involve a background image in a <div> that's fixed. Is is possible to achieve a similar parallax effect if my image is in a <img> tag?


回答1:


Provided you use the same attributes then yeah sure it can

An example of this can be seen here: http://webdesign.tutsplus.com/tutorials/complete-websites/create-a-parallax-scrolling-website-using-stellar-js/



来源:https://stackoverflow.com/questions/17392988/is-it-possible-to-parallax-an-img-tag-rather-than-background-image-in-a-div

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!