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
.ui-thumbVideo:hover{ | |
opacity:.8; | |
} | |
html.no-opacity .ui-thumbVideo:hover{ | |
filter: alpha(opacity=80); /* ie */ | |
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; /* ie 8 */ | |
} |
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
/** | |
* $.fn.normalizeAnchor | |
* changes anchor's href which referes the id in the page. | |
* ex: change <a href="/foobar/#hogehoge">...</a> to <a href="#hogehoge">...</a> | |
* if your location is http://somewhere/foobar/. | |
*/ | |
$.fn.normalizeAnchor = function(){ | |
var l = location; | |
var pathWoHash = l.protocol + '//' + l.host + l.pathname; | |
return this.each(function(){ |
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
/* | |
There's <meta name="viewport" content="width=480" /> in html then... | |
*/ | |
// handle Android's viewport | |
(function($, undefined){ | |
$.browser.android = /android/i.test(navigator.userAgent); | |
if(!$.browser.android){ |
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
$.browser.android = /android/i.test(ua); | |
$.browser.legacyAndroid = function(){ | |
if(!$.browser.android){ | |
return false; | |
} | |
var threshold = 2.2; | |
var res = ua.match(/android\s?([^;^-]+)/i); | |
if(!res || res.length<2){ | |
return false; |
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
<img | |
src="hogehoge_on.png" | |
data-srcoff="hogehoge_off.png" | |
data-preloadattr="srcoff" | |
alt="" | |
/> |
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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.js"></script> | |
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.5.min.js"%3E%3C/script%3E'))</script> |
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 ua = navigator.userAgent; | |
$.browser.iPhone = /iphone/i.test(ua); | |
$.browser.iPhoneLt4 = function(){ | |
if(!$.browser.iPhone){ | |
return false; | |
} | |
if(window.devicePixelRatio >= 2){ | |
return false; | |
} |
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
img{ | |
-webkit-touch-callout:none; /* iOS Safari */ | |
-webkit-user-select:none; /* iOS Safari */ | |
touch-callout:none; | |
user-select:none; | |
} |
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
function writeLastCode(){ | |
var $s = $('script'); | |
document.write('<pre></pre>'); | |
var $pre = $('pre').last(); | |
$pre.last().text($($s[$s.length-2]).text().replace(/\t/g,' ').replace(/\n/,'')); | |
} | |
/* | |
use like following |
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
/* === jQuery UI widget way === */ | |
$.widget('ui.dashboard', { | |
_create: function(){ | |
alert('hey widget was created!'); | |
console.log(this.element); // this is what you attached. | |
} | |
}); | |
$('#div1').dashboard(options); |