Parallax tests
How do I make an parallax tests?
What is a parallax tests? How do you make a parallax tests? This script and codes were developed by Ex HTML on 15 September 2022, Thursday.
Parallax tests - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Parallax tests</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="main"> fru1<br><br>fru2<br><div class="prlx-box-inline">Inline</div><br>fru3<br><br>fru4<br><br>fru5<br><br>fru6<br><br>fru7<br><br>fru8<br><br>frucor<br><br>fru9<br><br> fru10<br><br>fru11<br><br>fru12<br><br>fru<br><br>fru<br><br>fru<br><br>fru<br><br>fru<br><br>frucor<br><br>fru<br><br> fru<br><br>fru<br><br>fru<br><br>fru<br><br>fru<br><br>fru<br><br>fru<br><br>fru<br><br>frucor<br><br>fru<br><br>
</div>
<div class="prlx-box prlx-lev0">Level 0</div>
<div class="prlx-box prlx-lev1">Level 1</div>
<div class="prlx-box prlx-lev2">Level 2</div>
<div class="prlx-box prlx-lev3">Level 3</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Parallax tests - Script Codes CSS Codes
.main {width:900px; background:#ccc; margin:0 auto}
.prlx-box,
.prlx-box-inline {width:300px; height:100px;}
.prlx-box {position:absolute;}
.prlx-box-inline {position:relative; background:#0f0}
.prlx-lev0 {background:#0ff; top:100px; left:100px; z-index:1; transition: all 0.3s ease-in-out }
.prlx-lev1 {background:#f0f; top:300px; right:300px; z-index:2; /*transition: all 0.3s ease-in-out 0.1s*/}
.prlx-lev2 {background:#ff0; top:150px; left:300px; z-index:3; transition: all 0.3s ease-in-out 0.2s}
.prlx-lev3 {background:#f00; top:200px; right:10px; z-index:4; transition: all 0.3s ease-in-out}
Parallax tests - Script Codes JS Codes
var didScroll = false, wScrTop, $body = $('body'), $document = $(document), $window = $(window), $prlx_i = $('.prlx-box-inline'), $prlx_0 = $('.prlx-lev0'), $prlx_1 = $('.prlx-lev1'), $prlx_2 = $('.prlx-lev2'), $prlx_3 = $('.prlx-lev3');
$document.ready(function(){ $window.scroll(function(e) { wScrTop = $window.scrollTop(); if( !didScroll ) { didScroll = true;
// - - -
/* sintaxis 1 para crossbrowsing */
$prlx_i.css({ "-webkit-transform":"translate(0px,"+wScrTop*0.8+"px)"
});
/* sintaxis 2 mas sencilla pero creo que en FF no va */
$prlx_0.css('transform', 'translateY('+wScrTop*0.6+'px)');
$prlx_1.css('transform', 'translateY('+wScrTop*0.4+'px)');
$prlx_2.css('transform', 'translateY('+wScrTop*0.2+'px)');
/* nums por encima de 0 hay que pasarlos a negativo */
$prlx_3.css('transform', 'translateY(-'+wScrTop*1.1+'px)');
// - - - didScroll = false; } });
});
Developer | Ex HTML |
Username | exhtml |
Uploaded | September 15, 2022 |
Rating | 3 |
Size | 2,238 Kb |
Views | 32,384 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Pure css tabs | 3,289 Kb |
Intramurs Typo | 2,065 Kb |
Typography test 2 | 1,737 Kb |
Slides-05-1 BOX-MODEL | 1,637 Kb |
Fluid layout | 2,200 Kb |
Test animation rotate concentric | 2,799 Kb |
Slides-09-2 MENU | 1,675 Kb |
Slides-10-1 BACKGROUND | 1,581 Kb |
What The Flexbox | 2,320 Kb |
Slides-07-1 POSITION | 1,909 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Vertically rotating text with CSS | Nopr | 2,141 Kb |
Lecture 1 | Law | 0 Kb |
Vue.js | Thommyboy02 | 1,506 Kb |
Vanilla JS - A toggleClass function | Woodwork | 2,532 Kb |
Adding Items | Valhead | 4,008 Kb |
React Markdown Previewer | C0d0er | 3,190 Kb |
Modal Dialog | Gigaleet | 2,251 Kb |
Simple blog concept | Drew_mc | 2,666 Kb |
Wrap_Test | Mscfourn | 7,503 Kb |
BSP Dungeon Generation | Xgundam05 | 5,326 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!