Build the MIT App Inventor

7 views
Skip to first unread message
is duplicateview conversation

Osama

unread,
Aug 31, 2019, 3:35:32 AM8/31/19
to MIT App Inventor Forum
Hi everybody,

I have a code in html but I need someone to advise me on how to build it on Mit App Inventor.

<!DOCTYPE html>
   <head>
 <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>


</head>
<body>

<script>
var counter = 0; // will reset each time the page loads, so you may need a WebViewString value passed by the app to set this ? !!!
var pages = 20; // for example - also could be set by WebViewString value from app
</script>

<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>

  </head>
   
<body>
    <div data-role = "page" id = "page1">
        
        <div data-role = "header">
        </div>

        <div data-role = "main" class = "ui-content">
            <span style = "color:orange"></span>
        </div>
        
</div>
</body>

</html>

blocks (4).png
blocks (5).png
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages