Navigation

    Monaca & Onsen UI
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. Tom
    T
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    Tom

    @Tom

    0
    Reputation
    2
    Posts
    732
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Tom Follow

    Posts made by Tom

    • RE: ons-carousel-item

      I seem to have an issue with the methode: setActiveIndex(). It only seems to effective when a page is actually loaded and shown.

      My page is built in a way as shown below and I want the carousel to dynamically move to a specific item
      during the init of the page, based on a provided parameter.

      <ons-carousel swipeable auto-scroll overscrollable id=“carousel”>
      <ons-carousel-item>
      item A
      </ons-carousel-item>
      <ons-carousel-item>
      item B
      </ons-carousel-item>
      <ons-carousel-item>
      item C
      </ons-carousel-item>
      </ons-carousel>

      To achieve this I use something like the code below during the page init event:

      var myCarousel = document.querySelector('#carousel');
      myCarousel.setActiveIndex(1);  
      
      • (zero based array)

      Testing the value with getActiveIndex() shows that setting the index worked, but when the page is shown always the first carousel item is show. regardless of the set value.

      When I apply the same code in the ‘show’ event it works, just like with a button click event on the page. Can be due to the fact the items are not added to the DOM yet at init phase? Well I could live with that, but the jump to the set item is noticeable and that is really not great.

      What do I do wrong and would be a solution for this?

      posted in JavaScript Core
      T
      Tom
    • Gap between ons-toolbar and statusbar iOS

      0_1511636460346_Image.png

      For some reason I suddenly observe a gap between the toolbar and the iOS statusbar (iPhone 6s, iOS 11), see the attached example.

      To troubleshoot this issue and to be sure it was not part of my own code that caused this I took the code of the very simple example of the toolbar reference at https://onsen.io/v2/api/js/ons-toolbar.html to see what happened (no own css file used) and the same behaviour is observed.

      I am using Cordova to build the App and used the basis settings for the config.xml which are part of the standard Cordova app template. I am applying version 2.8.2 of Onsen, also tried the CDN version.

      To confirm it’s not Cordova, I also used a kitchensick from Framework7 and no gap was observed with the same Cordova setup, so something is on going with the Onsen setup.

      Anyhow an idea what is going on?

      Greetings,
      Tom

      posted in Developer Corner
      T
      Tom