我正在使用Materialise Framework来创建PhoneGap应用程序.
他们有一个视差设置,你可以在这里看到他们的符号:
http://materializecss.com/parallax.html
当我运行它时,我的图像根本不显示.我的HTML看起来像这样:
<div class="row">
<div class="col s12 m7">
<div class="card">
<div class="parallax-container" style = "height:100px;">
<div class="parallax"><img src="/img.png"></div>
</div>
<div class="card-content">
<h5> test</h5>
<h6> test</h6>
<h6> test </h6>
</br>
<p> test</p>
</div>
<div class="card-action">
<a href="#">This is a link</a>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我不知道为什么但是$ scope不能用于回调相机.(OnSuccess功能)
HTML
<button ng-click="capturePhoto();">Capture</button>
<span>{{ test }}</span>
Run Code Online (Sandbox Code Playgroud)
JAVASCRIPT
app.controller('myController', function($scope, $http) {
$scope.capturePhoto = function(){
$scope.test = "test 1";
navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
destinationType: Camera.DestinationType.DATA_URL });
}
function onSuccess(imageData) {
var image = imageData;
alert($scope); // [object Object]
alert($scope.test); // test1
$scope.test = "test 2"; // Problem: do not show on screen
alert($scope.test); // test2
}
});
Run Code Online (Sandbox Code Playgroud)
该页面仍显示test1.难道我做错了什么?有最佳方法吗?
谢谢