Skip to content

Instantly share code, notes, and snippets.

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

Joerg Schoeneburg jswebschmiede

🏠
Working from home
View GitHub Profile
@jswebschmiede
jswebschmiede / snippet.js
Created September 6, 2012 22:31 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
* Tip: http://pivotallabs.com/users/jdean/blog/articles/1400-working-with-asynchronously-loaded-javascript
*/
(function(doc, script) {
var js,
@jswebschmiede
jswebschmiede / gist:4046054
Created November 9, 2012 14:38 — forked from corydorning/Cross-Browser ::before and ::after pseudo-class polyfill
Cross-Browser ::before and ::after pseudo-class polyfill
/* =============================================================================
CSS Declarations
========================================================================== */
/* ==|== The Standard Way =================================================== */
.foo::before {
/* ...css rules... */
}
@jswebschmiede
jswebschmiede / navobject.css
Created November 12, 2012 19:41
A CSS object for many nav styles
/** the nav object **/
.nav {}
.nav ul { margin-bottom: 0; }
.nav li {
list-style: none;
list-style-image: none;
margin-left:0;
}
/** nav object for horizontal navigations **/
.nav.horizontal ul,
@jswebschmiede
jswebschmiede / array.php
Created November 16, 2012 00:32
Jedes 2. Element / Jedes X-te Element im Array
// Array
$array = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
foreach($array as $key => $value) {
if(($key%2)===0 && $key > 0) {
echo $value;
}
}
@jswebschmiede
jswebschmiede / mq.css
Created December 10, 2012 14:43 — forked from csswizardry/mq.css
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@jswebschmiede
jswebschmiede / base.js
Created December 18, 2012 13:15
Cross-Browser Placeholder Support, auch für Passwort Felder im IE, mit Modernizr.
/* Modernizr load */
Modernizr.load({
test : Modernizr.input.placeholder,
nope : './js/ext/placeholderfix.js'
});
(function() {
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement("style");
msViewportStyle.appendChild(
document.createTextNode("@-ms-viewport{width:auto!important}")
);
document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
}
})();
@jswebschmiede
jswebschmiede / cross_minmax_width.css
Created March 26, 2013 13:01
Cross Browser min-widht and max-width
/* this CSS create a minimum width of 750px: */
#wrapper {
min-width: 750px;
width:expression(document.body.clientWidth < 750? "750px": "auto" );
}
/* this CSS create a minimum width of 750px and a max-width of 1220px */
#wrapper {
min-width: 750px;
max-width: 1220px;
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
@mixin hr-image($image, $width, $height) {
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(-o-min-device-pixel-ratio: 5/4),
(min-resolution: 120dpi) {
background-image: url($image);
@jswebschmiede
jswebschmiede / scrollto.js
Created April 17, 2013 13:53
scroll to element with jQuery
function scrollToEle($ele) {
var x = $($ele).offset().top;
$('html,body').animate({scrollTop: x}, 500);
}
$(document).ready(function(){
scrollToEle('#test-div');
});