Skip to content

Instantly share code, notes, and snippets.

View atomize's full-sized avatar
🎹
♩♩

Berti atomize

🎹
♩♩
View GitHub Profile
@atomize
atomize / jQuery_form_hijack.html
Created March 1, 2012 07:00
jQuery form hijack anchor href (link) ajax
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.form.js"></script>
<script>
$(document).ready(function(){
$('a').bind('click',function(event){
event.preventDefault();
$.get(this.href,{},function(response){
@atomize
atomize / jquery_preloadimages.js
Created March 1, 2012 07:08
jQuery preloadImages
jQuery.preloadImages = function() {
for (var i = 0; i < arguments.length; i++) {
jQuery("<img>").attr("src", arguments[i]);
}
}
@atomize
atomize / reload_window_resize.js
Created March 1, 2012 07:10
jQuery reload window on resize
$(window).bind('resize',function(){
     window.location.href = window.location.href;
});
@atomize
atomize / fadein_all_img.js
Created March 1, 2012 07:11
jQuery fade in all images on page load
$(document).ready(function() {
$('img').each(function() {
$(this).css({
opacity: 0
}).bind('load', function() {
$(this).animate({
opacity: 1
}, 'slow');
});
});
@atomize
atomize / jQuery_iScroll_Flickr.html
Created March 1, 2012 07:41
jQuery Mobile, iScroll, and Flickr API JSON multi-page example
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>jQuery Mobile - iScroll - Flickr JSON</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
@atomize
atomize / webkit_prevent.css
Created March 1, 2012 07:43
CSS - Webkit - prevent default ugliness when you touch things
* {
/* prevent callout to copy image, etc when tap to hold */
-webkit-touch-callout: none;
/* prevent webkit from resizing text to fit */
-webkit-text-size-adjust: none;
/* make transparent link selection, adjust last value opacity 0 to 1.0 */
-webkit-tap-highlight-color: rgba(0,0,0,0);
@atomize
atomize / jQ_searchTwitter.html
Created March 1, 2012 07:46
jQuery search Twitter - get results in JSON
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Search Twitter</title>
</head>
<body>
<input type="text" id="query" /><button>search</button><br />
<div id="results">
</div>
@atomize
atomize / truecolumns.css
Created March 1, 2012 07:51
True pure CSS columns that won't be fuxed with by shat browsers
#container
{
width: 790px;
}
#group_1-8
{
float: left;
width: 630px;
}
#group_9
@atomize
atomize / jQMobile_jQUItabs.html
Created March 1, 2012 07:55
jQuery Mobile + jQuery UI tabs boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Tabs - Default functionality</title>
<link rel="stylesheet" href="http://jqueryui.com/themes/base/jquery.ui.all.css">
<script src="http://jqueryui.com/jquery-1.7.1.js"></script>
<script src="http://jqueryui.com/ui/jquery.ui.core.js"></script>
<script src="http://jqueryui.com/ui/jquery.ui.widget.js"></script>
@atomize
atomize / iosCSS.html
Created March 1, 2012 07:59
iOS icon in pure CSS3 (with rando cool CSS image in background :-)
<style>
.icon {
background: #33CC00;
background-image:url(http://www.cyberdesignz.com/blog/wp-content/uploads/2009/12/CSS.png);
background-repeat:no-repeat;
background-position:center;
background-size:100%;
width: 128px;
height: 128px;
border-radius: 19px;