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

I've e across a number of parallaxing tutorials (this one in particular I'm looking at now:

I've e across a number of parallaxing tutorials (this one in particular I'm looking at now: /); 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?

I've e across a number of parallaxing tutorials (this one in particular I'm looking at now: http://net.tutsplus./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?

Share Improve this question asked Jun 30, 2013 at 17:28 MattMatt 2,3277 gold badges42 silver badges53 bronze badges 2
  • Sure, they're both elements, they both can be positioned with CSS, and they both can be repositioned with JavaScript. – user2437417 Commented Jun 30, 2013 at 17:54
  • The reason for background image is that it's CSS-only solution. Other solutions require using Javascript. – jave.web Commented Sep 17, 2018 at 0:05
Add a ment  | 

1 Answer 1

Reset to default 3

Provided you use the same attributes then yeah sure it can

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744724261a4590088.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信