Skip to content

Instantly share code, notes, and snippets.

View ariona's full-sized avatar
🏠
Working from home

Rian Ariona ariona

🏠
Working from home
View GitHub Profile
@ariona
ariona / pxtoem-function.scss
Created November 20, 2015 07:53
Pixel to Em function for SASS
$browser-context: 16;
@function em($pixels, $context: $browser-context) {
@if (unitless($pixels)) {
$pixels: $pixels * 1px;
}
@if (unitless($context)) {
$context: $context * 1px;
}
@ariona
ariona / script.js
Created November 16, 2015 04:41
CSS show/hide animation
// User HoverIntent
$(".dropdown-menu .menu-item-has-children").hoverIntent(
function(){
var isMega = $(this).hasClass("mega-menu");
var sub = $(this).find("> .sub-menu");
if( isMega ){
$(sub).css("display","table");
} else {
$(sub).show();