Note that there are some explanatory texts on larger screens.

plurals
  1. POI am using jquery mobile to create phonegap for my first app
    primarykey
    data
    text
    <p>I have created five index for my app. the first index is for welcome screen. the second index is for capture,take pic, dragable crop tool, zoom in and zoom out. I wonder that it only work with some script only, but when I refresh on second index one it work well with all function.</p> <p>Can anyone tell me about this problem?</p> <p>My Html code goes here: jQuery Moblie test</p> <pre><code>&lt;script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/TakePhoto.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/drag.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile- 1.0a3.min.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile- 1.0a3.min.css" /&gt; &lt;link rel="stylesheet" href="css/style.css" /&gt; &lt;link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.min.css" /&gt; &lt;link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" /&gt; &lt;link rel="stylesheet" href="docs/assets/css/jqm-docs.css" /&gt; &lt;link rel="stylesheet" href="docsdemos-style-override.css" /&gt; &lt;script type='text/javascript' src="js/jquery-ui-1.9.2.custom.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui- 1.9.2.custom.min.css"/&gt; &lt;script type='text/javascript' src="js/jQuery.ui.touch-punch.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" id="takephoto" &gt; &lt;div data-role="header" class="ui-bar ui-bar-b" data-theme="b"&gt; &lt;h1&gt;Choose a photo for left Person !&lt;/h1&gt; &lt;a href="index.html" data-role="button" data-mini="true" data-theme="b" id="backtochoose"&gt;Back&lt;/a&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;h2&gt;Choose a photo for &lt;strong&gt;Left&lt;/strong&gt; Person!&lt;/h2&gt; &lt;a href="#" id="capture" data-role="button" data-ajax="false" rel="external" data-theme="b"&gt;Take a photo&lt;/a&gt; &lt;a href="#" id="getImg" data-role="button" data-ajax="false" rel="external" data-theme="b"&gt;Choose from library&lt;/a&gt; &lt;/div&gt; &lt;div id="image_container" style="display:block;"&gt; &lt;img style="display:none" id="image" width="300" height="350" src="" /&gt; &lt;center&gt;&lt;canvas id="mystore1" width="200" height="200" style="background- color:#03F"&gt;&lt;/canvas&gt;&lt;/center&gt; &lt;div class="frame" opacity:0.3&gt;&lt;img id="face" width="80" height="80" class="frames" src="img/face.jpg" /&gt;&lt;/div&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;a href="#" data-role="button" id="large" data-ajax="false" rel="external" data-inline="true"&gt;Larger&lt;/a&gt; &lt;a href="#" data-role="button" id="small" data-ajax="false" rel="external" data-inline="true"&gt;Smaller&lt;/a&gt; &lt;a href="#" data-role="button" id="rotate-left" data- inline="true"&gt;Left&lt;/a&gt; &lt;a href="#" data-role="button" id="rotate-right" data- inline="true"&gt;Right&lt;/a&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;a href="index2.html" data-role="button" data-iconpos="right" data- icon="arrow-r" data-theme="b" &gt;Next&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>My script goes here:</p> <pre><code>var pictureSource; // picture source var destinationType; // sets the format of returned value // Wait for PhoneGap to connect with the device document.addEventListener("deviceready",onDeviceReady,false); // Cordova is ready to be used! // function onDeviceReady() { pictureSource=navigator.camera.PictureSourceType; destinationType=navigator.camera.DestinationType; } // Called when a photo is successfully retrieved function onPhotoDataSuccess(imageData) { // Uncomment to view the base64 encoded image data var im=document.getElementById('image'); im.style.display = 'block'; im.src="data:img/jpeg;base64," +imageData; // console.log(imageData); } // Called when a photo is successfully retrieved function onPhotoURISuccess(imageURI) { // Uncomment to view the image file URI // console.log(imageURI); var largeImage = document.getElementById('largeImage'); // Unhide image elements // largeImage.style.display = 'block'; // Show the captured photo // The inline CSS rules are used to resize the image // largeImage.src = imageURI; // Get image handle var image = document.getElementById('image'); var imgCnt = document.getElementById('image_container'); // Unhide image container imgCnt.style.display = 'block'; // Unhide image elements image.style.display = 'block'; // Show the captured photo // The inline CSS rules are used to resize the image image.src = imageURI; } // A button will call this function function capturePhoto() { // Take picture using device camera and retrieve image as base64-encoded string navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,destinationType: destinationType.DATA_URL, correctOrientation: true, targetWidth:200, targetHeigth:200 }); } // A button will call this function function getImage(source) { // Retrieve image file location from specified source navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, destinationType: destinationType.FILE_URI, sourceType: source,correctOrientation: true }); } // Called if something bad happens. function onFail(message) { alert('Failed because: ' + message); } // Called when capture operation is finished function captureSuccess(mediaFiles) { } // Called if something bad happens. function captureError(error) { var msg = 'An error occurred during capture: ' + error.code; navigator.notification.alert(msg, null, 'Uh oh!'); } $("#capture").live('click',function(event){ capturePhoto(); }); $("#getImg").live('click',function(event){ getImage(pictureSource.SAVEDPHOTOALBUM); }); $(document).live(function(e) { $(".frame").draggable(); }); $("#large").live('click',function(event){ var wsize=$('img.frames').width(); var hsize=$('img.frames').height(); $('img.frames').width(wsize * 1.2); $('img.frames').height(hsize * 1.2); }); $("#small").live('click',function(event){ var wsize=$('img.frames').width(); var hsize=$('img.frames').height(); $('img.frames').width(wsize * 0.8); $('img.frames').height(hsize * 0.8); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload