Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This project put in scene Parallax animation. The use is really easy and simple. You don't need a CSS file

License

NotificationsYou must be signed in to change notification settings

MSay2/Simple-Parallax-HTML-JavaScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The using this animation on your project HTML is really simple and ease
You don't need to have a CSS file, the JavaScript file takes charge certain properties

Use

copy the parallax.js file and note this<script> tag on your HTML file
<scriptsrc="./parallax.js"></script>

First

Create a<div> tag with a name of classparallax-container

The name of this class is really really important.

<divclass="parallax-container"></div>

Secondly

Insert the attributedata-type and insert the valueparallax to this attribute

This valueparallax is for notifying than the element is executable as animation of the Parallax.

data-type="parallax"

Thirdly

Insert the attributedata-min-height and insert the valuenumber PX to this attribute

This is to configure the minimal height, if this value is empty, she send an null value and the height minimal will be of 200px.

data-min-height="380px"

Fourth

Insert the attributedata-src and insert the directory access of your image

This attributedata-src is for applying of your image,src correspond to Source of your image, if this attribute send an value null or if this attribute is not insert on your<div> tag or if the diretory of access to your image is incorrect, theconsole.error() stipulate that an error is committed.

data-src="./parallax-background.png"

More

Note that your image will execute like an Parallax, the animation will be good, but you can also add an animation of scrolling for the image and exclusive for your image, this is for an parallax again more thrust and more beautiful

Insert the attributedata-animation in your<div> tag and insert thetrue value to this attribute

Now look at how the animations acts like with and without this attribute. And look at the difference.

data-animation="true"
This attribute is for the control of the speed of animation of the Parallax

Insert the attributedata-division in your<div> tag and insert an value encrypted (a number).

4 is a default number

data-division="4"

List of all attributes

The attributedata-min-width is obsolete for the moment
  • data-type
  • data-min-height
  • data-min-width
  • data-src
  • data-animation
  • data-division

License

Copyright (c) 2019 MSay2Licensed to the Apache Software Foundation (ASF) under one or more contributorlicense agreements. See the NOTICE file distributed with this work foradditional information regarding copyright ownership. The ASF licenses thisfile to you under the Apache License, Version 2.0 (the "License"); you may notuse this file except in compliance with the License. You may obtain a copy ofthe License at   http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS, WITHOUTWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See theLicense for the specific language governing permissions and limitations underthe License.

About

This project put in scene Parallax animation. The use is really easy and simple. You don't need a CSS file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp