Home >Web Front-end >HTML Tutorial >How do you achieve the image scrolling effect at the top of this web page? Thank you_html/css_WEB-ITnose

How do you achieve the image scrolling effect at the top of this web page? Thank you_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:08:461408browse

This is it: http://www.nilock.com/2011/05/19/a-parallax-scrolling-demo/comment-page-1/

Please help me take a look, thank you , I am a newbie...


Reply to discussion (solution)

Constantly modify
background-position

Apply Made with js

These clouds are all the same picture, and then use JS to make them move. It looks layered. Both CSS3 and JS can do it!

$( function($) {	        var current = 0;		setInterval(function(){	       if(current==-6000) {current=0;}	       current -=600;	       $('#header-background').animate({backgroundPosition:current+"px 0px"},25000);	    },2500);	}) 

Modify background-position

JScript code

$( function($) {
var current = 0;
setInterval( function(){
if(current==-6000) {current=0;}
current -=600;
$('#header-background').an......

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn