This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lastScrollTop = 0; | |
$(window).scroll(function(){ | |
var scrollTop = window.pageYOffset; | |
if(scrollTop > lastScrollTop){ | |
console.log('down') | |
} else { | |
console.log('up') | |
} | |
lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).scroll(function() { | |
var top_of_element = $("#element").offset().top; | |
var bottom_of_element = $("#element").offset().top + $("#element").outerHeight(); | |
var bottom_of_screen = $(window).scrollTop() + window.innerHeight; | |
var top_of_screen = $(window).scrollTop(); | |
if((bottom_of_screen > top_of_element) && (top_of_screen < bottom_of_element)){ | |
// The element is visible, do something | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( ".variations_form" ).on( "woocommerce_variation_select_change", function () { | |
// Fires whenever variation selects are changed | |
} ); | |
$( ".single_variation_wrap" ).on( "show_variation", function ( event, variation ) { | |
// Fired when the user selects all the required dropdowns / attributes | |
// and a final variation is selected / shown | |
} ); | |
// another trick |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul { | |
list-style: none; | |
line-height: 1em; | |
font-size: 3vw; | |
} | |
ul li:before { | |
content: ""; | |
line-height: 1em; | |
width: .5em; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="toggle"> | |
<input type="checkbox" id="switcher" class="check"> | |
<b class="switch"></b> | |
</div> | |
/* css */ | |
.toggle { | |
display: inline-block; | |
vertical-align: middle; | |
margin: 10px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply to flex-childs | |
-webkit-flex-grow: 0; | |
flex-grow: 0; | |
-webkit-flex-shrink: 0; | |
flex-shrink: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source: https://jsfiddle.net/fk63zzbz/529/ | |
<!-- Navigation --> | |
<div class="navbar navbar-default navbar-inverse" role="navigation"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle"> | |
<span class="sr-only">Toggle Navigation</span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input, textarea { | |
-webkit-appearance: none; | |
border-radius: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="wpcf7-form-control wpcf7-radio"> | |
<span class="wpcf7-list-item"> | |
<label class=""> | |
<input type="radio" value="Yes"> | |
<span class="wpcf7-list-item-label">Yes</span> | |
</label> | |
</span> | |
</span> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myArray.filter(x => x.id === '45') | |
// it returns array with an object if its find matching object |