Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

html - jQuery - draggable images on iPad / iPhone - how to integrate event.preventDefault();? -


i use jquery, jquery ui , jquery mobile build web application iphone / ipad. create images , should draggable, did this:

<!doctype html> <html>     <head>         <meta http-equiv="content-type" content="text/html; charset=utf-8">         <title>drag - test</title>         <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" />         <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script>         <script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>         <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script>     </head>      <body>     <div>         <div style="width:500px;height:500px;border:1px solid red;">             <img src="http://upload.wikimedia.org/wikipedia/en/thumb/9/9e/jquery_logo.svg/200px-jquery_logo.svg.png" class="draggable" alt="jquery logo" />             <img src="http://upload.wikimedia.org/wikipedia/en/a/ab/apple-logo.png" class="draggable" alt="apple inc. logo" />         </div>     </div> </body>  <script type="text/javascript">     $(document).ready(function() {         $(".draggable").draggable();     }); </script> </html> 

here can see live example: http://jsbin.com/igena4/

the problem is, whole page want scroll. searched in apple's html5 examples , found prevent scrolling of page, image draggable:

... ondragstart: function(event) {     // stop page panning on iphone/ipad - we're moving note, not page     event.preventdefault();     ... } 

but problem me, how can include jquery? event?

best regards.

try library

https://github.com/furf/jquery-ui-touch-punch

just follow these simple steps enable touch events in jquery ui app:

  1. include jquery , jquery ui on page.

    <script src="http://code.jquery.com/jquery.min.js"></script> <script src="http://code.jquery.com/ui/1.8.17/jquery-ui.min.js"></script> 
  2. include touch punch after jquery ui , before first use.

    please note if using jquery ui's components, touch punch must included after jquery.ui.mouse.js, touch punch modifies behavior.

    <script src="jquery.ui.touch-punch.min.js"></script> 
  3. there no 3. use jquery ui expected , watch work @ touch of finger.

    <script>$('#widget').draggable();</script> 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -