View clone_increment.html
<div class="input_fields_wrap"> | |
<div> | |
<input type="text" name="fields[contact][new1][fields][contactName]" /><br /> | |
<input type="text" name="fields[contact][new1][fields][contactSurname]" /><br /> | |
<input type="text" name="fields[contact][new1][fields][contactEmail]" /> | |
</div> | |
<button class="add_field_button">Add More Fields</button> | |
</div> |
View clearfix-mixin.scss
@mixin clearfix { | |
&:after { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
} | |
.wrap { | |
@include clearfix; |
View vertical-align.css
.parent-element { | |
-webkit-transform-style: preserve-3d; | |
-moz-transform-style: preserve-3d; | |
transform-style: preserve-3d; | |
} | |
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); |
View show-hide-search.js
// Header Search | |
$('.search a').on('click', function(event){ | |
event.preventDefault(); | |
var search = $(this).attr('href'); | |
$(search).css('right', '0'); | |
}); | |
// Hide search on document click | |
$(document).mouseup(function(e){ |
View .htaccess
<ifModule mod_headers.c> | |
# Turn on Expires and set default expires to 3 days | |
ExpiresActive On | |
ExpiresDefault A259200 | |
# Set up caching on media files for 1 month | |
<filesMatch ".(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt)$"> | |
ExpiresDefault A2419200 | |
Header append Cache-Control "public" | |
</filesMatch> |
View Redirect a single page
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html | |
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/ |
View scroll-up-bar.css
body { | |
padding-top: 40px; | |
} | |
header { | |
background: #f5b335; | |
height: 40px; | |
position: fixed; | |
top: 0; | |
transition: top 0.2s ease-in-out; |
View character-limiter.js
(function($) { | |
$.fn.extend( { | |
limiter: function(limit, elem) { | |
$(this).on("keyup focus", function() { | |
setCount(this, elem); | |
}); | |
function setCount(src, elem) { | |
var chars = src.value.length; | |
if (chars > limit) { | |
src.value = src.value.substr(0, limit); |
View equal-height-rows.css
article { | |
float: left; | |
width: 23%; | |
background: #ccc; | |
margin: 10px 1%; | |
padding: 1%; | |
} | |
@media all and (max-width: 900px) { | |
article { |
NewerOlder