This file contains 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 topOffsetOfElement = $('#element').offset().top; | |
$(window).scroll(function (event) { | |
// get the y position of the scroll | |
var y = $(this).scrollTop(); | |
// is that below the element | |
if (y >= top) { | |
// add fixed | |
$('#element').addClass('fixed'); |
This file contains 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
/* Thx to csstricks.com */ | |
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ |
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>My Page</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<link rel="stylesheet" href="css/style.css"> | |
</head> | |
<body> |
This file contains 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
.htaccess | |
wp-config.php | |
wp-content/uploads/ | |
wp-content/blogs.dir/ | |
wp-content/upgrade/ | |
wp-content/backup-db/ | |
wp-content/advanced-cache.php | |
wp-content/wp-cache-config.php | |
sitemap.xml | |
*.log |
This file contains 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
/* Bootstrap's Media Queries */ | |
/* Large desktop */ | |
@media (min-width: 1200px) { ... } | |
/* Portrait tablet to landscape and desktop */ | |
@media (min-width: 768px) and (max-width: 979px) { ... } | |
/* Landscape phone to portrait tablet */ | |
@media (max-width: 767px) { ... } |
This file contains 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="pagination"> | |
{% if page.previous %} | |
<a class="pagination-item older" href="{{page.previous.url}}">Older</a> | |
{% else %} | |
<span class="pagination-item older">Older</span> | |
{% endif %} | |
{% if page.next %} | |
<a class="pagination-item newer" href="{{page.next.url}}">Newer</a> | |
{% else %} | |
<span class="pagination-item newer">Newer</span> |
This file contains 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
<!-- drop this into your post.html or other page template --> | |
<div id="reading-time"></div> | |
<span id="wordcount" style="display:none">{{ content | number_of_words }}</span> |
This file contains 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
// reading time | |
$('#reading-time').html(function(){ | |
var wordcount = $('#wordcount').text(); | |
timetoread = Math.round(wordcount / 200); | |
readmessage = timetoread + " min read"; | |
return readmessage; | |
}); |
This file contains 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
$("#back_to_top").click(function(e){ | |
e.preventDefault(); | |
$('html, body').animate({scrollTop:0}, 'slow'); | |
}); |
This file contains 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
// takes a parent el (like a li) and goes to work on its children | |
// assumes the parent has one label and one input | |
function labelsToPlaceholders(parent) { | |
$(parent).each( function(index){ | |
$(this).children('label').css('display', 'none'); | |
labelText = $(this).children('label').text(); | |
labelText = labelText.slice(0,-1); | |
// console.log(labelText); | |
$(this).children('input').attr('placeholder', labelText); |
OlderNewer