Hybrid development: AppFrameworks mobile development framework defines page layout

Hybrid development: AppFrameworks mobile development framework defines page layout

In this code, we will use the appframeworks framework to build a super simple image preview application, using basic page definitions. It does not require you to write any independent JavaScript code. It is super fast and cool, and is very suitable for everyone to develop mobile applications based on hybrid mode.

  1. < div   id = "afui" >  
  2.  
  3. < div   id = "header" >  
  4. <!--
  5. You don't need to define it here, af will automatically render it as follows:
  6. <   id = "backButton"   href = "javascript:;"   class = "button"   style = "visibility: hidden; " > Back </ a >  
  7. < h1   id = "pageTitle" > Page Title </ h1 >  
  8. -- >   
  9. </ div >  
  10.    
  11. < div   id = "content" >  
  12.      
  13. <!-- Define Home Page -->  
  14. < div   id = "main"   class = "panel"   data-title = "Home"   selected = "true" >  
  15.        
  16. <!-- Define a list -->  
  17. < ul   class = "list" >  
  18. < li > < a   href = "#page1"   class = "icon picture" > Page 1 </ a > </ li >  
  19. < li > < a   href = "#page2"   class = "icon picture" > Page 2 </ a > </ li >  
  20. </ ul >  
  21.        
  22. </ div >  
  23.      
  24. <!-- Definition page 1 -->  
  25. < div   id = "page1"   class = "panel"   data-title = "Page 1" >  
  26.        
  27. <!-- Define a picture list here -->  
  28. < ul   class = "list" >  
  29.          
  30. <!-- Add a scroll to bottom button -->  
  31. < li >  
  32. <   href = "#"   class = "icon down"   onclick = "$.ui.scrollToBottom('page1');" > Scroll to the bottom </ a >  
  33. </ li >  
  34.          
  35. < li > < img   src = "http://www.gbtags.com/gb/laitu/500x200&text=palette/222222/ffffff" > </ li >  
  36. < li > < img   src = "http://www.gbtags.com/gb/laitu/500x200&text=palette/444444/ffffff" > </ li >  
  37. < li > < img   src = "http://www.gbtags.com/gb/laitu/500x200&text=palette/666666/ffffff" > </ li >  
  38. < li > < img   src = "http://www.gbtags.com/gb/laitu/500x200&text=palette/888888/ffffff" > </ li >  
  39. < li > < img   src = "http://www.gbtags.com/gb/laitu/500x200&text=palette/aaaaaa/ffffff" > </ li >  
  40. < li > < img   src = "http://www.gbtags.com/gb/laitu/500x200&text=palette/cccccc/bbbbbb" > </ li >  
  41. < li > < img   src = "http://www.gbtags.com/gb/laitu/500x200&text=palette/dddddd/aaaaaa" > </ li >  
  42. < li > < img   src = "http://www.gbtags.com/gb/laitu/500x200&text=palette/eeeeee/999999" > </ li >  
  43.          
  44. <!-- Add a scroll to top button -->  
  45. < li >  
  46. <   href = "#"   class = "icon up"   onclick = "$.ui.scrollToTop('page1');" > Scroll to the bottom </ a >  
  47. </ li >  
  48. </ ul >  
  49.        
  50. </ div >  
  51.      
  52. <!-- Definition page 2 -->  
  53. < div   id = "page2"   class = "panel"   data-title = "Page 2" >  
  54. <!-- Image Content -->  
  55. < img   src = "http://www.gbtags.com/gb/laitu/500x200/dd4814/ffffff" >  
  56. < img   src = "http://www.gbtags.com/gb/laitu/500x200/dd4814/000000" >  
  57.        
  58. </ div >  
  59.      
  60. </ div >  
  61.    
  62. < div   id = "navbar" >  
  63. <!-- Define the navigation bar -->  
  64. <   href = "#main"   class = "icon home" > Home </ a >  
  65. <   href = "#page1"   class = "icon picture" > Page 1 </ a >  
  66. <   href = "#page2"   class = "icon picture" > Page 2 </ a >  
  67. </ div >  
  68.    
  69. </ div >  
  70.  
  71.  
  72. <!-- Selector Class Library -->  
  73. < script   src = "http://cdn.gbtags.com/appframework/2.1/appframework.min.js" > </ script >  
  74. <!-- Related UI class library -->  
  75. < script   src = "http://cdn.gbtags.com/appframework/2.1/appframework.ui.min.js" > </ script >  
  76. <!-- In order to better simulate the trigger scrolling of mobile devices in desktop browsers, add a plug-in provided by ap -->  
  77. < script   src = "http://cdn.gbtags.com/appframework/2.1/af.desktopBrowsers.js" > </ script >  

Then:

  1. /* Import af related CSS */  
  2.  
  3. @ import url( 'http://cdn.gbtags.com/appframework/2.1/af.ui.css' ); /* ui related */  
  4. @ import url( 'http://cdn.gbtags.com/appframework/2.1/icons.css' ); /* Icon related */  
  5.  
  6. /*Define beautify css */  
  7. body{
  8. font-family: 'microsoft yahei' ,Arial,sans-serif;
  9. margin:0;
  10. padding:0;
  11. }
  12.  
  13. #page1 img{  
  14. max-width: 100%;
  15. }

Code effect playback page: http://www.gbtags.com/gb/rtreplayerpreview/167.htm

<<:  What can we learn from Apple's 2014?

>>:  The ill-fated fate of the movie "Steve Jobs" is enough to make another movie

Recommend

What is the Tik Tok feed? Everything you want to know is here!

Unknowingly, feed stream (also known as informati...

Logarithms: The mathematical discovery all astronomers should be grateful for

Tables of logarithms have been a useful tool for ...

Ningxia confirmed 1 imported plague case! Details announced

According to the Ningxia Health Commission websit...

Android phone fluency ranking: Xiaomi fifth, OnePlus first, where is Huawei?

As we all know, mobile phones are divided into tw...

A case study of brand IPization that achieved great results with little effort

Every brand wants to build itself into an IP, but...

5 ways to promote your app

Now when you open the app store, whether it is fr...

How to find accurate seed users? Attached with classic practical cases!

Analysis ideas for finding seed users : The follo...