Skip to content

Instantly share code, notes, and snippets.

@cacheleocode
cacheleocode / iba_adobe_edge_widget.js
Created May 7, 2013 22:25
snippet to insert into Adobe Edge Animate gesture actions
e.preventDefault();
@cacheleocode
cacheleocode / detect_online_status.js
Created June 10, 2013 22:30
detect online status
// insert code for mouse click here
if (window.navigator.onLine)
{
sym.$("US_map_symbol").show();
}
else
{
sym.$("US_map_symbol_offline").show();
}
switch(tz.name())
{
case "America/Caracas":
// execute code block 1
break;
case 2:
// execute code block 2
break;
@cacheleocode
cacheleocode / countdown.html
Created June 27, 2013 19:55
with a check for time zones
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/jquery.countdown.js"></script>
<script type="text/javascript" src="js/jstz-1.0.4.min.js"></script>
@cacheleocode
cacheleocode / adobe_edge_animate_yepnope.js
Created July 15, 2013 21:54
How to use yepnope in Adobe Edge Animate
// for use in stage action creationComplete
yepnope({
nope:['edge_includes/XXXXXXXX.js'] ,
complete: init
});
function init (){
// code to be executed
}
var ScrollAnimator = function() {
var settings = {},
page,
started = false,
paused = false,
animation = null;
var w = $(window),
d = $(document),
open HTML file in finder, prevent default gesture behavior:
add -webkit CSS snippet
<style type="text/css">
*
{
-webkit-touch-callout: none;
-webkit-user-select: none;
}
</style>
// for use in stage action creationComplete
this.swipeStartX;
this.swipeEndX;
this.swipeStartY;
this.swipeEndY;
this.swipePadding = 60; // prevent swipe when clicking
this.onSwipeLeft = function()
{
// extra_finish.touchend
if (e.pageY == undefined)
{
var touch = e.originalEvent.touches [0] || e.originalEvent.changedTouches [0];
this.swipeEndY = touch.pageY;
if(this.swipeEndY < this.swipeStartY - 60) // swipe up
{
//this code converts touch events to mouse events
function touchHandler(event) {
var touches = event.changedTouches,
first = touches[0],
type = "";
switch (event.type) {
case "touchstart": type = "mousedown"; break;
case "touchmove": type = "mousemove"; break;
case "touchend": type = "mouseup"; break;