Skip to content

Instantly share code, notes, and snippets.

View danmaispace's full-sized avatar
🎯
Focusing

Danmai danmaispace

🎯
Focusing
  • www.danmai.com.cn
  • Shenzhen,China
View GitHub Profile
@danmaispace
danmaispace / gist:3856368
Created October 9, 2012 03:16 — forked from padolsey/gist:527683
Javascript: detect ie
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@danmaispace
danmaispace / APOD-app-tap-listener.js
Created February 28, 2012 08:02 — forked from edspencer/APOD-app-tap-listener.js
The app.js file for a simple Sencha Touch 2 APOD app
/**
* The final thing is to add a tap listener that is called whenever the user taps on the screen.
* We do a quick check to make sure they're not tapping on the carousel indicators (tapping on
* those indicators moves you between items so we don't want to override that), then either hide
* or show the info Component.
*/
Ext.Viewport.element.on('tap', function(e) {
if (!e.getTarget('.x-carousel-indicator')) {
if (titleVisible) {
info.element.removeCls('apod-title-visible');