{"id":9567,"date":"2024-01-20T18:05:00","date_gmt":"2024-01-20T18:05:00","guid":{"rendered":"https:\/\/codehim.com\/?p=9567"},"modified":"2024-01-22T16:05:52","modified_gmt":"2024-01-22T11:05:52","slug":"multi-layer-parallax-effect-in-javascript","status":"publish","type":"post","link":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/","title":{"rendered":"Multi Layer Parallax Effect in JavaScript"},"content":{"rendered":"<p>This JavaScript code creates a multi-layer parallax effect. It uses mouse movement and scrolling to animate various shapes and text elements on the webpage. The code sets up functionalities for both mouse and scroll-based parallax movements. By toggling checkboxes, you can activate <a href=\"https:\/\/codehim.com\/animation-effects\/background-parallax-effect-on-mouse-move\/\" target=\"_blank\" rel=\"noopener\">parallax motion on mouse movement<\/a> or scrolling.<\/p>\n<p>The code relies on the position of the mouse cursor or scroll position to create a depth effect, moving elements in different directions based on the user&#8217;s actions.<\/p>\n<h2>How to Create Multi-Layer Parallax Effect In JavaScript<\/h2>\n<p>1. To begin, let&#8217;s create the HTML structure for your web page. You can customize the content, but ensure you include the necessary elements for the parallax effect. Replace the sample elements with the <code>&lt;section&gt;<\/code> tag with the elements you want to apply the parallax effect to.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;h1&gt;Parallaxe Multiply Layer&lt;\/h1&gt;\r\n&lt;div&gt;\r\n  &lt;p&gt;Use the Checkboxes to test Scroll or Mouse Parallax&lt;\/p&gt;\r\n  &lt;input type=\"checkbox\" id=\"mm\" checked value=\"mouse move\"&gt;\r\n  &lt;label for =\"mm\"&gt;Parallax on Mouse move&lt;\/label&gt;\r\n  &lt;input type=\"checkbox\" id=\"sm\" checked value=\"scroll move\"&gt;\r\n  &lt;label for =\"sm\"&gt;Parallax on Scroll&lt;\/label&gt;\r\n&lt;\/div&gt;\r\n&lt;section class=\"container\"&gt;\r\n  \r\n  &lt;div class=\"element-wrapper\"&gt;\r\n    Rectangle\r\n    &lt;div class=\"image-layer\" data-image-layer=\"tardis\"&gt;&lt;\/div&gt;\r\n    &lt;svg width=\"100%\" height=\"100%\" class=\"parallaxe-layer\"&gt;\r\n      &lt;rect x=\"25%\" y=\"25%\" width=\"50%\" height=\"50%\" fill=\"#55F545\"\/&gt;\r\n    &lt;\/svg&gt;\r\n  &lt;\/div&gt;\r\n  \r\n  &lt;div class=\"element-wrapper\"&gt;\r\n    Circle\r\n    &lt;div class=\"image-layer\" data-image-layer=\"tardis\"&gt;&lt;\/div&gt;\r\n    &lt;svg width=\"100%\" height=\"100%\" class=\"parallaxe-layer\"&gt;\r\n      &lt;circle cx=\"50%\" cy=\"50%\" r=\"30%\" fill=\"#55F545\" \/&gt;\r\n    &lt;\/svg&gt;\r\n  &lt;\/div&gt;\r\n  \r\n  &lt;div class=\"element-wrapper\"&gt;\r\n    Path\r\n    &lt;div class=\"image-layer\" data-image-layer=\"tardis\"&gt;&lt;\/div&gt;\r\n    &lt;svg width=\"100%\" height=\"100%\" class=\"parallaxe-layer\"&gt;\r\n      &lt;path d=\"M164.06,212.46C147.19,140.6,0,0,0,0H81.56s-26.78,90.38-15,109.27c13,20.77,82.92,6.74,97.5-12.14C177.32,80,164.06,0,164.06,0h93.75s-14.42,87,0,105.63c7.46,9.65,42.19,0,42.19,0V212.46l-53,68.6-83-.61-15,19.43-67.5-87.42,140.63-98.34L29.06,159V267.1s223.82,74,247.5,0c8-25-59.06-76.49-59.06-76.49S183,265.83,165.94,257.39C157.83,253.36,166.59,223.22,164.06,212.46Z\" transform=\"translate(-3 -2)\" fill=\"#55F545\"\/&gt;\r\n    &lt;\/svg&gt;\r\n  &lt;\/div&gt;\r\n  \r\n  &lt;div class=\"element-wrapper\"&gt;\r\n    Polygon\r\n    &lt;div class=\"image-layer\" data-image-layer=\"tardis\"&gt;&lt;\/div&gt;\r\n    &lt;svg width=\"100%\" height=\"100%\" class=\"parallaxe-layer\"&gt;\r\n      &lt;polygon points=\"150,20 330,190 110,280\" fill=\"#55F545\" \/&gt;\r\n    &lt;\/svg&gt;\r\n  &lt;\/div&gt;\r\n  &lt;div class=\"element-wrapper\"&gt;\r\n    Text\r\n    &lt;div class=\"image-layer\" data-image-layer=\"tardis\"&gt;&lt;\/div&gt;\r\n    &lt;svg width=\"100%\" height=\"100%\" class=\"parallaxe-layer\"&gt;\r\n      &lt;text x=\"100\" y=\"10\" fill=\"#55F545\" transform=\"rotate(30 20,40)\" font-size=\"5.5em\" font-weight=\"bold\"&gt;JUST&lt;\/text&gt;\r\n      &lt;text x=\"40\" y=\"100\" fill=\"#55F545\" transform=\"rotate(30 20,40)\" font-size=\"5.5em\" font-weight=\"bold\"&gt;TEXT!&lt;\/text&gt;\r\n    &lt;\/svg&gt;\r\n  &lt;\/div&gt;\r\n  \r\n  &lt;div class=\"element-wrapper\"&gt;\r\n    Rectangle with Offset + Blur filter\r\n    &lt;div class=\"image-layer\" data-image-layer=\"tardis\"&gt;&lt;\/div&gt;\r\n    &lt;svg width=\"100%\" height=\"100%\" class=\"parallaxe-layer\"&gt;\r\n      &lt;filter id=\"f1\" x=\"0\" y=\"0\" width=\"200%\" height=\"200%\"&gt;\r\n        &lt;feOffset result=\"offOut\" in=\"SourceGraphic\" dx=\"30\" dy=\"30\" \/&gt;\r\n        &lt;feGaussianBlur result=\"blurOut\" in=\"offOut\" stdDeviation=\"5\" \/&gt;\r\n        &lt;feBlend in=\"SourceGraphic\" in2=\"blurOut\" mode=\"normal\" \/&gt;\r\n      &lt;\/filter&gt;\r\n      &lt;rect x=\"25%\" y=\"25%\" width=\"50%\" height=\"50%\" fill=\"#55F545\" stroke=\"red\" stroke-width=\"6px\" filter=\"url(#f1)\" \/&gt;\r\n    &lt;\/svg&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/section&gt;\r\n&lt;div class=\"spacer\"&gt;for more scrolling&lt;\/div&gt;\r\n<\/pre>\n<p>2. Create a CSS file (styles.css) to define the styles for your elements and configure the parallax effect. Here&#8217;s a sample CSS code:<\/p>\n<pre class=\"prettyprint linenums lang-css\">* {\r\n  margin: 0;\r\n  padding: 0;\r\n  box-sizing: border-box;\r\n  vertical-align: middle;\r\n}\r\n\r\n.cd__main{\r\n    display: block !important;\r\n    background: linear-gradient(to right, #e0eafc, #cfdef3) !important;\r\n}\r\n\r\nhtml, body {\r\n  height: 100%;\r\n}\r\n\r\nbody {\r\n  text-align: center;\r\n  padding: 1.5rem;\r\n}\r\n\r\nh1 {\r\n  display: inline-block;\r\n  font-weight: normal;\r\n  border-bottom: thin solid black;\r\n  margin: 1em;\r\n}\r\n\r\n.container {\r\n  display: flex;\r\n  min-height: 15em;\r\n  flex-wrap: wrap;\r\n  justify-content: center;\r\n}\r\n\r\n.element-wrapper {\r\n  margin: 5em;\r\n  position: relative;\r\n  width: 20%;\r\n  height: 20em;\r\n}\r\n.element-wrapper div {\r\n  position: absolute;\r\n}\r\n\r\n[data-image-layer] {\r\n  position: relative;\r\n  height: 100%;\r\n  width: 100%;\r\n  background-size: cover;\r\n  background-position-x: center;\r\n  background-blend-mode: multiply;\r\n  transition: background-color 0.5s;\r\n}\r\n\r\n.parallaxe-layer {\r\n  mix-blend-mode: multiply;\r\n}\r\n\r\n[data-image-layer=tardis] {\r\n  background-image: url(http:\/\/thenerdstash.com\/wp-content\/uploads\/2015\/05\/Tardis-HD-2.jpg);\r\n}\r\n\r\n.spacer {\r\n  min-height: 1000px;\r\n}\r\n\r\n.no-background-blend-mode .parallaxe-layer {\r\n  opacity: 0.6;\r\n}<\/pre>\n<p>3. Now, let&#8217;s add the JavaScript code for the parallax effect. Create a JavaScript file (script.js) and add the following code:<\/p>\n<pre class=\"prettyprint linenums lang-js\">document.addEventListener(\"DOMContentLoaded\", function(){\r\n\tinitParallax();\r\n  \r\n  document.addEventListener('mousemove', mouseParallax);\r\n  document.addEventListener('scroll', scrollParallax)\r\n});\r\n\r\nvar cursorX = 0; var cursorY = 0;\r\nvar offsetX = 0; var offsetY = 0;\r\nvar depthXY = 0;\r\nvar scenes; var layers;   \r\n\r\n\/\/ Initialize variables\r\nfunction initParallax() {\r\n  scenes = document.querySelectorAll('.element-wrapper');\r\n  layers = document.querySelectorAll('svg');\r\n}               \r\n\r\n\/\/ Called on scroll\r\nfunction scrollParallax(event) {\r\n  if(document.getElementById('sm').checked) {\r\n    sP(layers, 0.9);\r\n  }\r\n}\r\n\r\n\/\/ Called on Mouse move\r\nfunction mouseParallax(event) {\r\n  if(document.getElementById('mm').checked) {\r\n    mP(event);\r\n  }\r\n}\r\n\r\n\/\/Mouse move Parallax \r\nfunction mP() {\r\n  cursorX = event.clientX;\r\n  cursorY = event.clientY;\r\n  for(i = 0; i&lt;=layers.length; i++){\r\n    depthXY = 0.3;\r\n    offsetX = ((cursorX * depthXY) \/ 8);\r\n    offsetY = ((cursorY * depthXY) \/ 8);\r\n    layers[i].style.transform = 'translate3d('+offsetX+'px,'+offsetY+'px,0px)';\r\n  }\r\n}\r\n\r\n\/\/Scrolling Parallax\r\nfunction sP($object, multiplier){\r\n  multiplier = typeof multiplier !== 'undefined' ? multiplier : 0.5;\r\n  multiplier = 1 - multiplier;\r\n  var from_top = window.pageYOffset;\r\n  var bg_css = '0' +(multiplier * from_top) + 'px';\r\n  for (var index = 0 ; index &lt; $object.length; index++) {\r\n    $object[index].style.marginTop = bg_css;\r\n  }\r\n}; \r\n\r\n\/\/IE Fallback\r\nif(typeof window.getComputedStyle(document.body).backgroundBlendMode == 'undefined') {\r\n  document.documentElement.className += \" no-background-blend-mode\";\r\n}<\/pre>\n<p>You can customize and extend this code to implement your own unique parallax effect on your web projects, providing users with an engaging and visually appealing experience<\/p>\n<p>That&#8217;s all! hopefully, you have successfully created a Parallax Effect on your webpage. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This JavaScript code creates a multi-layer parallax effect. It uses mouse movement and scrolling to animate various shapes and text&#8230;<\/p>\n","protected":false},"author":1,"featured_media":9587,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[209],"tags":[107],"class_list":["post-9567","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-animation-effects","tag-parallax"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Multi Layer Parallax Effect in JavaScript &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a Multi Layer Parallax Effect in JavaScript. You can view demo and download the source code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Multi Layer Parallax Effect in JavaScript &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a Multi Layer Parallax Effect in JavaScript. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeHim\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codehimofficial\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-20T18:05:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T11:05:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Asif Mughal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:site\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Asif Mughal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"Multi Layer Parallax Effect in JavaScript\",\"datePublished\":\"2024-01-20T18:05:00+00:00\",\"dateModified\":\"2024-01-22T11:05:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/\"},\"wordCount\":237,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png\",\"keywords\":[\"Parallax\"],\"articleSection\":[\"Animation &amp; Effects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/\",\"url\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/\",\"name\":\"Multi Layer Parallax Effect in JavaScript &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png\",\"datePublished\":\"2024-01-20T18:05:00+00:00\",\"dateModified\":\"2024-01-22T11:05:52+00:00\",\"description\":\"Here is a free code snippet to create a Multi Layer Parallax Effect in JavaScript. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png\",\"width\":1280,\"height\":960,\"caption\":\"Multi Layer Parallax Effect in JavaScript\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Animation &amp; Effects\",\"item\":\"https:\/\/codehim.com\/category\/animation-effects\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Multi Layer Parallax Effect in JavaScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codehim.com\/#website\",\"url\":\"https:\/\/codehim.com\/\",\"name\":\"CodeHim\",\"description\":\"Web Design Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"alternateName\":\"Web Design Codes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codehim.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codehim.com\/#organization\",\"name\":\"CodeHim - Web Design Code & Scripts\",\"url\":\"https:\/\/codehim.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"contentUrl\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"width\":280,\"height\":280,\"caption\":\"CodeHim - Web Design Code & Scripts\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codehimofficial\",\"https:\/\/x.com\/CodeHimOfficial\",\"https:\/\/www.instagram.com\/codehim\/\",\"https:\/\/www.linkedin.com\/company\/codehim\",\"https:\/\/co.pinterest.com\/codehim\/\",\"https:\/\/www.youtube.com\/@codehim\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\",\"name\":\"Asif Mughal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"caption\":\"Asif Mughal\"},\"description\":\"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.\",\"sameAs\":[\"https:\/\/codehim.com\"],\"url\":\"https:\/\/codehim.com\/author\/asif-mughal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Multi Layer Parallax Effect in JavaScript &#8212; CodeHim","description":"Here is a free code snippet to create a Multi Layer Parallax Effect in JavaScript. You can view demo and download the source code.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Multi Layer Parallax Effect in JavaScript &#8212; CodeHim","og_description":"Here is a free code snippet to create a Multi Layer Parallax Effect in JavaScript. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-20T18:05:00+00:00","article_modified_time":"2024-01-22T11:05:52+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png","type":"image\/png"}],"author":"Asif Mughal","twitter_card":"summary_large_image","twitter_creator":"@CodeHimOfficial","twitter_site":"@CodeHimOfficial","twitter_misc":{"Written by":"Asif Mughal","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"Multi Layer Parallax Effect in JavaScript","datePublished":"2024-01-20T18:05:00+00:00","dateModified":"2024-01-22T11:05:52+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/"},"wordCount":237,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png","keywords":["Parallax"],"articleSection":["Animation &amp; Effects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/","url":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/","name":"Multi Layer Parallax Effect in JavaScript &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png","datePublished":"2024-01-20T18:05:00+00:00","dateModified":"2024-01-22T11:05:52+00:00","description":"Here is a free code snippet to create a Multi Layer Parallax Effect in JavaScript. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/10\/Multi-Layer-Parallax-Effect-in-JavaScript.png","width":1280,"height":960,"caption":"Multi Layer Parallax Effect in JavaScript"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/animation-effects\/multi-layer-parallax-effect-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"Animation &amp; Effects","item":"https:\/\/codehim.com\/category\/animation-effects\/"},{"@type":"ListItem","position":3,"name":"Multi Layer Parallax Effect in JavaScript"}]},{"@type":"WebSite","@id":"https:\/\/codehim.com\/#website","url":"https:\/\/codehim.com\/","name":"CodeHim","description":"Web Design Code Snippets","publisher":{"@id":"https:\/\/codehim.com\/#organization"},"alternateName":"Web Design Codes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codehim.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codehim.com\/#organization","name":"CodeHim - Web Design Code & Scripts","url":"https:\/\/codehim.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/","url":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","contentUrl":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","width":280,"height":280,"caption":"CodeHim - Web Design Code & Scripts"},"image":{"@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codehimofficial","https:\/\/x.com\/CodeHimOfficial","https:\/\/www.instagram.com\/codehim\/","https:\/\/www.linkedin.com\/company\/codehim","https:\/\/co.pinterest.com\/codehim\/","https:\/\/www.youtube.com\/@codehim"]},{"@type":"Person","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed","name":"Asif Mughal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","caption":"Asif Mughal"},"description":"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.","sameAs":["https:\/\/codehim.com"],"url":"https:\/\/codehim.com\/author\/asif-mughal\/"}]}},"views":1317,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/9567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/comments?post=9567"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/9567\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/9587"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=9567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=9567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=9567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}