Code Snippets for
Your Webflow!

A community repo with code crumbs to give your websites that extra bit of functionality! ūüėČ
Start Searching
ÔĄ°Recent Code Crumbs
ÔĀ°
<!-- Dynamic Copyright Year -->
<script>
	// Dynamic Copyright Year
	var date = new Date().getFullYear();
	document.getElementById("year").innerHTML = date;
</script>
Preview Code Snippet. Get all the crumbs now!

Dynamic Copyright Year

This short Javascript code crumb will allow you to dynamically set the current year for your © copyright year in your footer automatically.

Author
Noah Raskin
Published
Feb 9, 2020
Demo
See Demo
No Demo
Get all the Crumbs
<!-- Custom Select Field Styles --> 
<style>
  /************ ADD YOUR VALUES BELOW ************/
  :root {
    /* ----------- Colors ----------- */
		--list-bg-color: white;
    --list-text-color: inherit; /* Use "inherit" to take on parent text color */
    --select-field-arrow-color: black; /* This is the select field arrow color */
    --border-color-active: black; /* Active State */
    --border-color-hover: #dcdcdd; /* Select Field could be the same as your form field border color */
    --list-item-bg-color: #ededed; /* Select Field Hover/Focus State */

    /* ----------- Spacing ----------- */
    --select-field-padding-left: 12px; /* Match the padding values for your form fields */
    --select-field-padding-right: 12px; /* Match the padding values for your form fields */
    --list-padding-top-bottom: 10px; /* This is the top and bottom padding for the dropdown list */
    --list-max-height: 150px; /* You can set this to "Auto" as well */
    --list-item-padding-left: 18px; 
    --list-item-padding-right: 18px;
    --list-item-min-height: 40px; /* This is the height of each list item in the dropdown */
    --list-item-line-height: 40px; /* This is the height of each list item in the dropdown */

             /* ^^^  Make sure both "line-height" and "min-height" are the same! ^^^  */
  }
  /************ END OF CUSTOM VALUES ************/



  .nice-select {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    clear: both;
    padding-left: var(--select-field-padding-left);
    padding-right: var(--select-field-padding-right);
    position: relative;
    text-align: left !important;
    -webkit-transition: all 0.2s ease-in-out;
    transition: all 0.2s ease-in-out;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
    white-space: nowrap; 
  }


  .nice-select:hover {
    border-color: var(--border-color-hover); 
  }


  .nice-select:active, .nice-select.open, .nice-select:focus {
    border-color: var(--border-color-active);
  }


  .nice-select:after {
    border-bottom: 2px solid var(--select-field-arrow-color);
    border-right: 2px solid var(--select-field-arrow-color);
    content: '';
    display: block;
    height: 5px;
    margin-top: -4px;
    pointer-events: none;
    position: absolute;
    right: 12px;
    top: 50%;
    -webkit-transform-origin: 66% 66%;
    -ms-transform-origin: 66% 66%;
    transform-origin: 66% 66%;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    -webkit-transition: all 0.15s ease-in-out;
    transition: all 0.15s ease-in-out;
    width: 5px; 
  }


  .nice-select.open:after {
    -webkit-transform: rotate(-135deg);
    -ms-transform: rotate(-135deg);
    transform: rotate(-135deg); 
  }


  .nice-select.open .list {
    opacity: 1;
    pointer-events: auto;
    -webkit-transform: scale(1) translateY(0);
    -ms-transform: scale(1) translateY(0);
    transform: scale(1) translateY(0); 
  }


  .nice-select.disabled {
    border-color: #ededed;
    color: #999;
    pointer-events: none; 
  }


  .nice-select.disabled:after {
    border-color: #cccccc; 
  }


  .nice-select.wide {
    width: 100%; 
  }


  .nice-select.wide .list {
    left: 0 !important;
    right: 0 !important; 
  }


  .nice-select.right {
    float: right; 
  }


  .nice-select.right .list {
    left: auto;
    right: 0; 
  }


  .nice-select.small {
    font-size: 12px;
    height: 36px;
    line-height: 34px; 
  }


  .nice-select.small:after {
    height: 4px;
    width: 4px; 
  }


  .nice-select.small .option {
    line-height: 34px;
    min-height: 34px; 
  }


  .nice-select .list {
    background-color: var(--list-bg-color);
    color: var(--list-text-color);
    border-radius: 5px;
    box-shadow: 0 7px 20px 0px rgba(68, 68, 68, 0.11);
    border-color: 3px solid #ededed;
    box-sizing: border-box;
    margin-top: 4px;
    opacity: 0;
    overflow: hidden;
    padding: var(--list-padding-top-bottom) 0px;
    pointer-events: none;
    position: absolute;
    top: 100%;
    left: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    max-height: var(--list-max-height);
    -webkit-transform-origin: 50% 0;
    -ms-transform-origin: 50% 0;
    transform-origin: 50% 0;
    -webkit-transform: scale(0.75) translateY(-21px);
    -ms-transform: scale(0.75) translateY(-21px);
    transform: scale(0.75) translateY(-21px);
    -webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out;
    transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out;
    z-index: 9; 
  }


  .nice-select .list:hover .option:not(:hover) {
    background-color: transparent !important; 
  }


  .nice-select .option {
    cursor: pointer;
    font-weight: 400;
    line-height: var(--list-item-line-height);
    list-style: none;
    min-height: var(--list-item-min-height);
    outline: none;
    padding-left: var(--list-item-padding-left);
    padding-right: var(--list-item-padding-right);
    text-align: left;
    -webkit-transition: all 0.2s;
    transition: all 0.2s;
  }

  .nice-select .option:first-child {
    display: none;
  }

  span.current {
    color: var(--list-text-color);
  }

  .nice-select .option:hover, .nice-select .option.focus, .nice-select .option.selected.focus {
    background-color: var(--list-item-bg-color);
  }

  .nice-select .option.selected {
    font-weight: bold; 
  }

  .nice-select .option.disabled {
    background-color: transparent;
    color: #999;
    cursor: default; 
  }

  .no-csspointerevents .nice-select .list {
  display: none; 
  }

  .no-csspointerevents .nice-select.open .list {
  display: block; 
  }
</style>
<!-- CUSTOM SELECT FIELD --> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-nice-select/1.1.0/js/jquery.nice-select.min.js">

<script>
	$(document).ready(function() {
  	$('select').niceSelect();
	});
</script>
Preview Code Snippet. Get all the crumbs now!

Custom Select Field

This snippet allows you to customize the select field for your forms replacing the default select UI and UX for an arguably nicer one.

Author
Hern√°n Sartorio
Published
Feb 7, 2020
Demo
See Demo
No Demo
Get all the Crumbs
<!-- Browser Back Button -->
<script>
$( document ).ready(function() {
	$( ".back-button__class-name" ).click(function() { // Create any class name between the " ". Then add this class name to any back button on that page.  
		window.history.back();
	});
});
</script>
Preview Code Snippet. Get all the crumbs now!

Browser Back Button

This short JQuery code crumb will allow you to add make any button (your dedicated back button) return the user to the previous page using the browser history.

Author
Noah Raskin
Published
Feb 4, 2020
Demo
See Demo
No Demo
Get all the Crumbs
<!-- Input Field Placeholder Animation --> 
<style>
  ::placeholder {
  	transition: all 350ms ease;
  }
  
  .your-input-class:focus::placeholder {
  	transform: translate(20px, 0);
    opacity: 0.0;
  }
  
  .your-textarea-class:focus::placeholder {
  	transform: translate(20px, 0);
    opacity: 0.0;
  }
</style>
Preview Code Snippet. Get all the crumbs now!

Custom Placeholder Animation

This small snippet allows you to animate or add a transition to your placeholder text when an input field is focused. You can expand on the transition animations to whatever you'd like.

Author
Noah Raskin
Published
Dec 16, 2019
Demo
See Demo
No Demo
Get all the Crumbs

HTML Tables

Here is an HTML table you can use in your Rich Text Elements or E-Commerce websites for products or simply to show data since Webflow doesn't natively support it yet.

</ head> Code
</ body> Code
Author
Noah Raskin
Published
Dec 14, 2019

How to use:

Scroll To Top

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

<!--Delay Page Transition-->
<script>
 $('classOrIdNameHere').click(function (e){
   e.preventDefault(); var goTo = this.getAttribute("href");
     setTimeout(function() {
       window.location = goTo;
     }, 1000);
 });
</script>

Author
Unknown
Published
Oct 13 2019

How to use:

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

Things to keep in mind:

  1. This is a numbered list item.
  2. This is a numbered list item.
  3. This is a numbered list item.
  4. This is a numbered list item.

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

<!--Delay Page Transition-->
<script>
 $('classOrIdNameHere').click(function (e){
   e.preventDefault(); var goTo = this.getAttribute("href");
     setTimeout(function() {
       window.location = goTo;
     }, 1000);
 });
</script>

Author
Unknown
Published
Oct 13 2019
Text Link

<!--Delay Page Transition-->
<script>
 $('classOrIdNameHere').click(function (e){
   e.preventDefault(); var goTo = this.getAttribute("href");
     setTimeout(function() {
       window.location = goTo;
     }, 1000);
 });
</script>

Author
Unknown
Published
Oct 13 2019

<!--Delay Page Transition-->
<script>
 $('classOrIdNameHere').click(function (e){
   e.preventDefault(); var goTo = this.getAttribute("href");
     setTimeout(function() {
       window.location = goTo;
     }, 1000);
 });
</script>

Author
Unknown
Published
Oct 13 2019
Text Link

<!--Delay Page Transition-->
<script>
 $('classOrIdNameHere').click(function (e){
   e.preventDefault(); var goTo = this.getAttribute("href");
     setTimeout(function() {
       window.location = goTo;
     }, 1000);
 });
</script>

Author
Unknown
Published
Oct 13 2019

<!--Delay Page Transition-->
<script>
 $('classOrIdNameHere').click(function (e){
   e.preventDefault(); var goTo = this.getAttribute("href");
     setTimeout(function() {
       window.location = goTo;
     }, 1000);
 });
</script>

Author
Unknown
Published
Oct 13 2019

Awesome Contributors

CodeCrumbs would not exist without these awesome contributions from the amazing people. They too believe in helping others achieve more with their designs and projects in Webflow.

Meet the Contributors
Text Link
Built by
Built with