EDIT: Wow, what an idiot I am. To make it very easy to understand, I wanted to explain the facebook native app sort of functionality. Where you touch the top right and top left, the middle portion goes in to left or right, revealing a side bar menu
I have a phonegap app wherein on the top right corner, there is a button. Take the below code as reference.
Portion of HTML:
<body>
<div id="header"><!--Button goes here--></div>
<div id="menu">
<ul>
<li> Option 1</li>
<li> Option 2</li>
</ul>
</div>
<div id="page">
Some contents in the page.
</div>
</body>
Javascript:
var move,x=0; //global vars
function buttonTouched() { //code for button ontouchstart event
move = $("#menu").css('width');
if(x==0) {
$("#menu").animate({'left':'-='+move},'250');
$("#page").animate({'left':'-='+move},'250');
x=1;
}
else if(x==1) {
$("#menu").animate({'left':'+='+move},'250');
$("#page").animate({'left':'+='+move},'250');
x=0;
}
}
When you touch the button, "menu" div slides left (using jquery animate) and a portion of the "page" div goes to the left. How do I replicate this effect in native app using objective C code with animate effect?
Thanks