We combined jQTouch and
Thanks to jQTouch for the Orientation Event. This page was created with a few lines of javascript.
// Overlay (div) var over = $('#over'); // ==================== // STEP 1: SUBSCRIBE() // ==================== // Listen for updates on 'jqtouch' channel. $.PUBNUB.subscribe( { channel : 'jqtouch' }, function(message) { // Get Orientation on Local and Remote Device var local_orientation = jQT.getOrientation() , remote_orientation = message.orientation; // Indicate Not Same Orientation (Show or Hide div#over) if (local_orientation != remote_orientation) over.show(); else over.hide(); // Console Debug console.log({ local_orientation : local_orientation, remote_orientation : remote_orientation, message : message }); } ); // -- end Subscribe() // ==================== // STEP 2: PUBLISH() // ==================== // Orientation callback event $('body').bind( 'turn', function( e, data ) { // Send update to 'jqtouch' channel. $.PUBNUB.publish({ channel : 'jqtouch', message : { orientation : data.orientation } }); // -- end Publish() }); // -- end Orientation Event Bind