Hello,
I inserted this code in the layout
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<title>TestApp</title>
<script type="text/javascript">
// code to execute on each page change
$("div[data-role*='page']").live('pageshow', function(event, ui)
{
$(this).bind('touchmove', function (e)
{ e.preventDefault(); });
}
</script>
<% is_bb6 = System::get_property('platform') == 'Blackberry' &&
(System::get_property('os_version').split('.')[0].to_i >= 6) %>
<% if is_bb6 %>
<meta name="viewport" content="width=device-width;
height=device-height; initial-scale=1.0; maximum-scale=1.0; user-
scalable=0;"/>
<% else %>
<meta name="viewport" content="width=device-width; initial-
scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<% end %>
<% if System::get_property('platform') == 'WP7' %>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"/>
<% end %>
<% if System::get_property('platform') == 'APPLE' ||
System::get_property('platform') == 'ANDROID' || is_bb6 ||
( System::get_property('platform') == 'UNKNOWN' &&
System::get_property('webview_framework') =~ /^WEBKIT/) %>
<script src="/public/jquery/jquery-1.6.4.min.js" type="text/
javascript"></script>
<script src="/public/js/application.js" type="text/javascript"></
script>
<link rel="stylesheet" href="/public/jqmobile/
jquery.mobile-1.0rc1.min.css">
<link rel="stylesheet" href="/public/css/jqmobile-patch.css">
<% if System::get_property('platform') == 'APPLE' %>
<link href="/public/jqmobile/jquery.mobile.iphone.css"
type="text/css" rel="stylesheet"/>
<% end %>
<script type="text/javascript">
$(document).bind("mobileinit", function(){
// jQuery-Mobile init options initialization goes
here. For example, you may
// enable automatically generated 'Back' buttons on
headers this way:
//$.mobile.page.prototype.options.addBackBtn = true;
// You can disable (with false value) or change page
loading message
$.mobile.loadingMessage = false;
//$.mobile.loadingMessage = "loading"; // it is
default value
// For documented init options look here:
//
http://jquerymobile.com/demos/1.0rc1/#/demos/1.0rc1/docs/api/globalconfig.html
// For poorly documented options search for
".prototype.options"
// in the jQuery Mobile source code
// Rhodes custom option!
// how long to wait transition end before "loading.."
message will be shown
$.mobile.loadingMessageDelay = 300; // in ms
});
</script>
<script type="text/javascript" charset="utf-8" src="/public/
jqmobile/jquery.mobile-1.0rc1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/js/
jqmobile-patch.js"></script>
<% end %>
<% if System::get_property('platform') == 'APPLE' %>
<link href="/public/css/iphone.css" type="text/css"
rel="stylesheet"/>
<link href="/public/css/ProgressBar.css" type="text/css"
rel="stylesheet"/>
<link href="/public/css/ulcontent.css" type="text/css"
rel="stylesheet"/>
<link href="/public/css/textInside.css" type="text/css"
rel="stylesheet"/>
<% elsif System::get_property('platform') == 'ANDROID' %>
<link href="/public/css/android.css" type="text/css"
rel="stylesheet"/>
<link href="/public/css/ProgressBar.css" type="text/css"
rel="stylesheet"/>
<% elsif is_bb6 %>
<link href="/public/css/android.css" type="text/css"
rel="stylesheet"/>
<% elsif System::get_property('platform') == 'Blackberry' %>
<link href="/public/css/blackberry.css" type="text/css"
rel="stylesheet"/>
<% elsif System::get_property('platform') == 'WP7' %>
<link href="/public/css/windows_mobile.css" type="text/css"
rel="stylesheet"/>
<script src="/public/js/wp7.js" type="text/javascript"></script>
<% elsif System::get_property('platform') == 'WINDOWS' %>
<link href="/public/css/windows_mobile.css" type="text/css"
rel="stylesheet"/>
<% elsif System::get_property('webview_framework') =~ /^WEBKIT/ %>
<link href="/public/css/android.css" type="text/css"
rel="stylesheet"/>
<% end %>
</head>
<body
<% if is_bb6 %>
data-do-fix-forms="true"
<% elsif System::get_property('platform') == 'WP7' %>
onload="wp7_change_forms_action_to_get()"
<% end %>
>
<%= @content %>
</body>
</html>
but still a m able to drag it in 4 directions.....I tried preivious
ones also.. same.....
Or i forgot something?
Thanks.
On Dec 23, 5:03 am, Jorge Daniel Sampayo Vargas <
jdsamp...@gmail.com>
wrote:
> or of all pages (the one I'm using)
>
> before including jquery mobile add in layout:
>
> <script type="text/javascript">
> // code to execute on each page change
> $("div[data-role*='page']").live('pageshow', function(event, ui) {
> $(this).bind('touchmove', function (e) { e.preventDefault(); });
> }
> </script>
>
> 2011/12/22 Lucas Campbell-Rossen <
lu...@rhomobile.com>
>
>
>
>
>
>
>
> > If you want to prevent any movement for a page the code below works. Put
> > it into your application.js file and include this file in the layout.
>
> > If I wanted to prevent horizontal and vertical movement for page with
> > id='testpage':
>
> > $('#testpage').live('pageshow', function() {
> > document.ontouchmove = function(event){ event.preventDefault(); }
> > })
>
> > $('#testpage').live('pagehide', function() {
> > document.ontouchmove = function(event){ }
> > })
>