Connect with:
About Me
Alessandro Annini
I'm a freelance developer currently working at Leaff.it/ I really love famo.us framework and its amazing potential and if you're like me, and you want the web to win, please share some snippet of code for the community and grow faster with us
Categories
Meta
Famo.us Code | Sizing a Surface within your Stylesheet
506
post-template-default,single,single-post,postid-506,single-format-standard,ajax_updown_fade,page_not_loaded,,qode-theme-ver-6.2.1

Sizing a Surface within your Stylesheet

08 Jul Sizing a Surface within your Stylesheet

Someone asked how they would be able to size a Surface within famous using a stylesheet. Seemed simple enough, but upon first try my render of the object within famous would overwrite the sizing of the object.

The trick is to size your surface with [true, true]:

var surface = new Surface({
classes: ['square'],
size: [true, true]
});

This allows the surface object to not apply the size (width and height) in famous.
The demo below shows the style changing on events:

Enjoy!
Tony

Tags:
, ,