Skip to content

Instantly share code, notes, and snippets.

@ideefixe
ideefixe / jquery_media_query.js
Last active December 11, 2015 10:38
Jquery media query
$(window).resize(function() {
var width = $(window).width();
if (width < 960) {
// Do Something
}
else {
//Do Something Else
}
});
@ideefixe
ideefixe / iphone_queries.css
Last active December 11, 2015 12:08
iPhone Media Queries
<!-- iPhone 2G, 3G, 3GS Portrait -->
@media only screen and (device-width: 320px) and (orientation: portrait) and not (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for iPhone in Portrait Orientation */
}
<!-- iPhone 2G, 3G, 3GS Landscape -->
@media only screen and (device-width: 480px) and (orientation: landscape) and not (-webkit-min-device-pixel-ratio: 2) {
/* CSS3 Rules for iPhone in Landscape Orientation */
}
@ideefixe
ideefixe / Conditional CSS
Created January 22, 2013 21:08
Conditional CSS
[if {!} browser]
[if {!} browser version]
[if {!} condition browser version]
! - indicates negation of the statement (i.e. NOT) - optional
browser - states which browser the statement targets
'IE' - Internet Explorer
'Gecko' - Gecko based browsers (Firefox, Camino etc)
'Webkit' - Webkit based browsers (Safari, Chrome, Shiira etc)
@ideefixe
ideefixe / target_firefox.css
Created January 22, 2013 21:16
Browser Media Queries
@-moz-document url-prefix() {
// css goes here
}
@ideefixe
ideefixe / ipad_media_queries.css
Created January 22, 2013 21:27
iPad Media Queries
/* iPads 1 & 2 (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* css goes here */
}
/* iPads 1 & 2 (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
@ideefixe
ideefixe / sitemap.php
Created January 23, 2013 18:39
WordPress Sitemap Template
<?php
/**
* Template Name: Sitemap
*/
?>
<h2 id="authors">Authors</h2>
<ul>
<?php
wp_list_authors(
@ideefixe
ideefixe / responsive_image_fix_ie8.css
Created January 25, 2013 19:16
Fix Responsive images in ie8
@media \0screen {img { width: auto }}
@ideefixe
ideefixe / form_validation.js
Created January 25, 2013 20:50
Javascript Form Validation
function init() {
$('#general').on('submit', function(e) {
pass = true;
$('input, textarea', this).removeClass('error');
$('input, textarea', this).each(function() {
if ($(this).val() === '') {
$(this).addClass('error');
pass = false;
}
@ideefixe
ideefixe / safari_version_targeting.js
Last active December 11, 2015 20:39
Safari Version Targeting
function isSafari() {
if (BrowserDetect.browser === 'Safari' && BrowserDetect.version < 6){ //detects safari versions less than 6
// JS goes here
if(window.devicePixelRatio){
}
@ideefixe
ideefixe / filp-image.css
Created January 28, 2013 20:54
Flip Image CSS
img {
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}