{"id":32035,"date":"2017-06-22T22:01:23","date_gmt":"2017-06-22T14:01:23","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=32035"},"modified":"2017-06-22T20:49:18","modified_gmt":"2017-06-22T12:49:18","slug":"build-cascading-animations-cascadejs","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/","title":{"rendered":"Create Cascading Effects Easily with CascadeJS"},"content":{"rendered":"<p>Fancy animations are a dime a dozen on the web. They\u2019re getting easier to create with tons of incredible <strong>animation libraries<\/strong>.<\/p>\n<p><strong><a href=\"https:\/\/bartboy011.github.io\/CascadeJS\/\" target=\"_blank\">Cascade.js<\/a><\/strong> is one more library to add to the list, and it\u2019s definitely a unique one. With Cascade, you can design custom animation effects using <strong>cascading letters<\/strong> in text or <strong>cascading elements<\/strong> in a main container.<\/p>\n<p>This library has <strong>no dependencies<\/strong>; it runs on classic JavaScript. You can install it through npm, Bower, or by downloading a copy right <a href=\"https:\/\/bartboy011.github.io\/CascadeJS\/\" target=\"_blank\">from GitHub<\/a>.<\/p>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/creative-css-animations\/\">30 Cool CSS Animations You Have To See<\/a><\/p>\n<p>To get CascadeJS working, you\u2019ll <strong>need two files<\/strong>: a CSS file and a JavaScript file. They both come packaged with <strong>minified versions<\/strong> to save you a few KBs on page size.<\/p>\n<p>Each Cascade element gets broken down into separate parts which <strong>animate individually<\/strong> through <code>&lt;span&gt;<\/code> elements. These are <strong>added dynamically<\/strong>, so you don\u2019t need to change anything in your HTML.<\/p>\n<p>But, you will need to <strong>set up the <code><a href=\"https:\/\/bartboy011.github.io\/CascadeJS\/#flow-usage\" target=\"_blank\">flow()<\/a><\/code> function<\/strong> in your file, after targeting whatever element you want to animate.<\/p>\n<p>You can actually <strong>use jQuery<\/strong> with this library if you want, however it\u2019s <strong>not required<\/strong>. So, if you prefer selecting elements with jQuery then feel free to use that instead.<\/p>\n<p>Here\u2019s a <strong>snippet of vanilla JavaScript<\/strong> from the main site\u2019s demo:<\/p>\n<pre>\r\n&lt;script&gt;\r\n  var element = document.getElementsByTagName('h1')[0];\r\n  var cascade = new Cascade(element).flow();\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>You can pass the <code>flow()<\/code> element with <strong>no parameters<\/strong>, or you can <strong>configure them all<\/strong> yourself. It takes <strong>eight optional parameters<\/strong> for editing the animation style, timing, duration, and optional CSS classes.<\/p>\n<p>CascadeJS has another function called <code><a href=\"https:\/\/bartboy011.github.io\/CascadeJS\/#fragment-usage\" target=\"_blank\">fragment()<\/a><\/code> which lets you <strong>split up letters (or elements)<\/strong> into separate containers, without animating them. You can use this function to <strong>color and restyle text<\/strong> on the page by targeting each individual letter in a word. Pretty cool, right?<\/p>\n<p>All <strong>code samples<\/strong> are openly available on the <a href=\"https:\/\/bartboy011.github.io\/CascadeJS\/\" target=\"_blank\">main library page<\/a>, so you can copy\/paste and tinker on your own. But, you\u2019ll also find the <strong>documentation<\/strong> on the <a href=\"https:\/\/github.com\/bartboy011\/CascadeJS\" target=\"_blank\">GitHub page<\/a> if you\u2019re looking for a clearer way to get started.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/build-cascading-animations-cascadejs\/02-cascade-js-scripts.jpg\" alt=\"CascadeJS plugin\" width=\"1000\" height=\"566\"><\/figure>\n<p class=\"note\"><strong>Read Also:<\/strong> <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/css3-animation-tools\/\">10 CSS3 Animation Tools You Should Bookmark<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Fancy animations are a dime a dozen on the web. They\u2019re getting easier to create with tons of incredible animation libraries. Cascade.js is one more library to add to the list, and it\u2019s definitely a unique one. With Cascade, you can design custom animation effects using cascading letters in text or cascading elements in a&hellip;<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3393],"tags":[3497],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Create Cascading Effects Easily with CascadeJS - Hongkiat<\/title>\n<meta name=\"description\" content=\"Fancy animations are a dime a dozen on the web. They&#039;re getting easier to create with tons of incredible animation libraries. Cascade.js is one more\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Cascading Effects Easily with CascadeJS\" \/>\n<meta property=\"og:description\" content=\"Fancy animations are a dime a dozen on the web. They&#039;re getting easier to create with tons of incredible animation libraries. Cascade.js is one more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-22T14:01:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/build-cascading-animations-cascadejs\/02-cascade-js-scripts.jpg\" \/>\n<meta name=\"author\" content=\"Jake Rocheleau\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jake Rocheleau\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/\"},\"author\":{\"name\":\"Jake Rocheleau\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\"},\"headline\":\"Create Cascading Effects Easily with CascadeJS\",\"datePublished\":\"2017-06-22T14:01:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/\"},\"wordCount\":350,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/build-cascading-animations-cascadejs\\\/02-cascade-js-scripts.jpg\",\"keywords\":[\"Javascript Library\"],\"articleSection\":[\"Toolkit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/\",\"name\":\"Create Cascading Effects Easily with CascadeJS - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/build-cascading-animations-cascadejs\\\/02-cascade-js-scripts.jpg\",\"datePublished\":\"2017-06-22T14:01:23+00:00\",\"description\":\"Fancy animations are a dime a dozen on the web. They're getting easier to create with tons of incredible animation libraries. Cascade.js is one more\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/build-cascading-animations-cascadejs\\\/02-cascade-js-scripts.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/build-cascading-animations-cascadejs\\\/02-cascade-js-scripts.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/build-cascading-animations-cascadejs\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Cascading Effects Easily with CascadeJS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/966b2daea15283b4145e71aa98a82c2a\",\"name\":\"Jake Rocheleau\",\"description\":\"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers\",\"sameAs\":[\"https:\\\/\\\/www.hongkiat.com\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/jake\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Create Cascading Effects Easily with CascadeJS - Hongkiat","description":"Fancy animations are a dime a dozen on the web. They're getting easier to create with tons of incredible animation libraries. Cascade.js is one more","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:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/","og_locale":"en_US","og_type":"article","og_title":"Create Cascading Effects Easily with CascadeJS","og_description":"Fancy animations are a dime a dozen on the web. They're getting easier to create with tons of incredible animation libraries. Cascade.js is one more","og_url":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2017-06-22T14:01:23+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/build-cascading-animations-cascadejs\/02-cascade-js-scripts.jpg","type":"","width":"","height":""}],"author":"Jake Rocheleau","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Jake Rocheleau","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/"},"author":{"name":"Jake Rocheleau","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a"},"headline":"Create Cascading Effects Easily with CascadeJS","datePublished":"2017-06-22T14:01:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/"},"wordCount":350,"commentCount":1,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/build-cascading-animations-cascadejs\/02-cascade-js-scripts.jpg","keywords":["Javascript Library"],"articleSection":["Toolkit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/","url":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/","name":"Create Cascading Effects Easily with CascadeJS - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/build-cascading-animations-cascadejs\/02-cascade-js-scripts.jpg","datePublished":"2017-06-22T14:01:23+00:00","description":"Fancy animations are a dime a dozen on the web. They're getting easier to create with tons of incredible animation libraries. Cascade.js is one more","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/build-cascading-animations-cascadejs\/02-cascade-js-scripts.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/build-cascading-animations-cascadejs\/02-cascade-js-scripts.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/build-cascading-animations-cascadejs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create Cascading Effects Easily with CascadeJS"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/966b2daea15283b4145e71aa98a82c2a","name":"Jake Rocheleau","description":"Jake is a writer and designer with over 10 years experience working on the web. He writes about user experience design and cool resources for designers","sameAs":["https:\/\/www.hongkiat.com"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/jake\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-8kH","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/32035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=32035"}],"version-history":[{"count":1,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/32035\/revisions"}],"predecessor-version":[{"id":32036,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/32035\/revisions\/32036"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=32035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=32035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=32035"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=32035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}