monaca

Onsen 2.0 - Adding event listener to Ons-Switch with Javascript

若如初见. 提交于 2019-12-20 03:53:49
问题 I fear I am missing something really simple, but I have tried multiple attempts with various errors. On to the code: <script> document.getElementById("optStats").on("change", function(e) { alert("Switch changed!"); }); </script> <ons-switch modifier="list-item" id="optStats"></ons-switch> So the above does not work. It generates an error of Uncaught TypeError: Cannot read property of on of null . So I assumed that I needed to add the function to the onload init function but it still failed

Onsen-ui combining carousel with range input & action listeners/methods

我是研究僧i 提交于 2019-12-10 15:27:26
问题 I have a onsen-ui project and I'm using Monaca Cloud IDE to build it. I'm still struggling with a few key concepts when it comes to onsen-ui, but I can't figure it out from readying the docs. At the moment I'm trying to implement a "range" input on a onsen carousel-item. The range input is rendered just fine, but I can't slide it. When I try to slide it, I actually scroll the carousel. My current idea to solve this problem is to set the entire carousel to "disabled", since it's not that

Add a login page in my Onsenui app

▼魔方 西西 提交于 2019-12-06 04:51:46
问题 I'd like to set a login page before entering the main page. How can I do that just before this instruction : <ons-screen page="sliding_menu.html"></ons-screen> I use The Monaca IDE Thanks for the help Charles 回答1: You can try this way: index.html <ons-screen page="login.html" login.js function LoginController($scope){ $scope.login = function(id, password){ $scope.ons.screen.presentPage('sliding_menu.html'); } } login.html <div class="page center" ng-controller="LoginController"> <div class=

Add a login page in my Onsenui app

一世执手 提交于 2019-12-04 09:47:23
I'd like to set a login page before entering the main page. How can I do that just before this instruction : <ons-screen page="sliding_menu.html"></ons-screen> I use The Monaca IDE Thanks for the help Charles You can try this way: index.html <ons-screen page="login.html" login.js function LoginController($scope){ $scope.login = function(id, password){ $scope.ons.screen.presentPage('sliding_menu.html'); } } login.html <div class="page center" ng-controller="LoginController"> <div class="row"> <div class="col"> <ons-text-input placeholder="id" ng-model="id"> </ons-text-input> </div> </div> <div