Replicate the counter used in the html in the blocks

1 view
Skip to first unread message
is duplicateview conversation

Osama

unread,
Sep 1, 2019, 2:45:53 PM9/1/19
to MIT App Inventor Forum
Hello friends,

How can I replicate the counter used in the html in the blocks.

<script>
         $(document).on("pagecreate","#page1",function() {
            $("body").on("swipeleft",function(){
            $("span").text(window.AppInventor.getWebViewString());
            });
         });
         if ( counter !== pages ) {
         counter = counter + 1;
window.AppInventor.setWebViewString(counter); 
         }
 </script>
 <script>
         $(document).on("pagecreate","#page1",function() {
            $("body").on("swiperight",function() {
              $("span").text(window.AppInventor.getWebViewString());
            });
         });
         if ( counter !== 0 ) {
         counter = counter - 1;
window.AppInventor.setWebViewString(counter); 
         }
 </script>
component_event.png
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages