Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/benfoxall/context-require

Context Require js
https://github.com/benfoxall/context-require

Last synced: 16 days ago
JSON representation

Context Require js

Awesome Lists containing this project

README

        

Context Require
=====

This is a tiny script that allows you to load (require) js files based on the content of a page.

Usage
-----

```html


This part is made all fancy




```

```js
//--fancy.js

define(['jquery'], function($){

$.fn.make_fancy = function(){
this.animate({fontSize:'+=50'})
};

return function(content){
$(content).find('p').make_fancy();
}

});

//--main.js

require(['cr']);

```

see [example.html](https://github.com/benfoxall/context-require/blob/master/example/example.html)