Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/benfoxall/context-require
- Owner: benfoxall
- License: mit
- Created: 2012-07-16T19:00:03.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-02T08:57:50.000Z (over 11 years ago)
- Last Synced: 2025-01-19T08:31:06.050Z (23 days ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.jsdefine(['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)