Created
August 4, 2011 13:26
-
-
Save krawaller/1125138 to your computer and use it in GitHub Desktop.
Demo object literals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
demos = [{ | |
description: "A parent with the layout property set to 'vertical' uses a vertical layout mechanism instead. Here, a child is placed in relation to the bottom of the previous child.", | |
children: [{height:80,width:100,left:30},{top:5,left:20,height:80,width:60}] | |
},{ | |
iphone: "Everything works as normal, even negative offsets (not on Android though!) and zIndexes. Except...", | |
android: "Negative top offsets have weird behaviour in a vertical layout on Android. Here, the second child ends up before the first!", | |
children: [{height:80,width:100,left:30,zIndex:1},{top:-5,left:20,height:80,width:60}] | |
},{ | |
iphone: "...the top and bottom properties are both used as margins (on Android only top!). So the height difference between two siblings is the sum of the bottom of the first and the top of the second.", | |
android: "The height difference between two siblings is controlled by the top property of the second sibling. On iPhone, the bottom prop of the first is added to the difference as well.", | |
children: [{height:80,width:100,left:10,bottom:10},{top:10,left:20,height:80,width:60}] | |
},{ | |
description: "The top property of the first child offsets it in relation to the parent. The bottom property of the last child is simply ignored.", | |
children: [{top:5,height:80,width:100,left:30},{top:10,left:20,height:80,width:100,bottom:500}] | |
}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment