Skip to content

Instantly share code, notes, and snippets.

@ozinepank
ozinepank / fixhoveriOS.js
Created April 6, 2013 10:12
Fixing the Hover event on the iPad/iPhone/iPod
//ipad and iphone fix
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
$(".menu li a").click(function(){
//we just need to attach a click event listener to provoke iPhone/iPod/iPad's hover event
//strange
});
}
// credit article : http://blog.0100.tv/2010/05/fixing-the-hover-event-on-the-ipadiphoneipod/
@ozinepank
ozinepank / actionhover.js
Last active December 16, 2015 01:09
AddClass if mouse hover and removeClass if user mouseleave
$(".action-a").mouseenter(function(){
$(this).addClass('action-hover');
}) ;
$(".dropdown").mouseleave(function(){
$(".action-a").removeClass('action-hover');
});
@ozinepank
ozinepank / hover-fadein-fadeout.html
Last active December 16, 2015 13:59
Hover element fadeIn and fadeOut
<!DOCTYPE html>
<head>
<title>Hover : show Nivagation</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="css/bootstrap.css"/>
<link rel="stylesheet" href="css/lab.css"/>
<script type="text/javascript" src="js/jquery-2.0.0.min.js"></script>
<script>
$(document).ready(function(){

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

$tappable-height:60px;
$default-border-radius:4px;
$Green: #97cb5b;
.ButtonStyle {
background:#fff;
display: inline-block;
border-radius:$default-border-radius;
font-size: 18px;
font-weight: bold;
cursor: pointer;
$tappable-height:60px;
$default-border-radius:4px;
$Green: #97cb5b;
%ButtonStyle {
background:#fff;
display: inline-block;
border-radius:$default-border-radius;
font-size: 18px;
font-weight: bold;
cursor: pointer;
%GutterPaddingContent {
padding:40px 20px;
}
.Content {
@extend %GutterPaddingContent /* Mobile */
}
@media all and (min-width: 1001px) {
%GutterPaddingContent {
@ozinepank
ozinepank / mixing-palceholder.scss
Last active November 18, 2015 04:00
Using Mixing pseudo palceholder (SASS)
@mixin psuedo-placeholder($color-placeholder) {
&::-webkit-input-placeholder {
color: $color-placeholder;
@include transition-color;
}
&:-moz-placeholder { /* Firefox 18- */
color: $color-placeholder;
@include transition-color;
}
@ozinepank
ozinepank / Padding-Hack.css
Last active November 30, 2022 15:39
The Padding-Bottom Hack
.img-container {
position: relative;
padding-bottom: 56.25%; /* 16:9 ratio */
height: 0;
overflow: hidden;
}
.img-container img {
position: absolute;
top: 0;