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 | How To
36
page-template-default,page,page-id-36,ajax_updown_fade,page_not_loaded,,qode-theme-ver-6.2.1

How To

You can post jsFiddle snippets doing this:

  • push the button on the right ‘NEW FIDDLE’
  • try not to reference other libraries (keep it real basic)
  • DO.CODE_
  • give it a meaningful name and a description
  • copy the url and make a new post;
  • use the jsFiddle button on the toolbar and paste the url.

FAMOUSBOX.JS IS MADE BY ME ONLY AND HAS NOTHING TO DO WITH FAMO.US OFFICIAL CODE, YOU USE IT ‘AT YOUR OWN RISK’ AND I AM NOT RESPONSIBLE FOR ANYTHING

..or you can import code from github or a simple gist with the last button on the same toolbar

..or you can just paste a codepen.io project url as it is, publish the post and it will be rendered properly!

Remember to always select a category when you publish it.

Your’re done, thanks!

 

If something that should work doesn’t check the first and last line of your code, they must be like that:

define('main', function (require, module) {

    // CODE

});

 

Thanks to Talves we discovered how simply is to use a widget/component right inside our fiddle:

  1. copy the hole widget code after your code;
  2. give it a name different from ‘main‘;
  3. call it with a simple require, like this:
define('main',function(require, exports, module) {
    var Engine = require('famous/core/Engine');
    var Modifier = require('famous/core/Modifier');
	// load our widget
    var Widget1 = require('widgetOne');
	
	// use it!
	var widget = new Widget1();
    
	// CODE
	
});


define('widgetOne',function(require, exports, module) {
    var Surface = require('famous/core/Surface');
    
	// CODE

});