samedi 7 février 2015

How to make Jquery plugins work with emberJS?

I'm trying to use the Jquery FlowType Plugin to make responsive text on my page. Everything was working fine before I set up ember, now the plugin stopped functioning.


Javascript for plugin:



<script>
$('p').flowtype({
fontRatio: 10
});

$('h1').flowtype({
minFont: 40,
maxFont: 140,
fontRatio: 6
});
</script>


HTML (in ember template)



<script type='text/x-handlebars' data-template-name='index'>
<h1>Writers Week</h1>
</script>


Applictaion.js (Ember routes)



var App = Ember.Application.create({
LOG_TRANSITIONS: true
});

App.Router.map(function () {
this.route('about');
})


After some research, I figured out that you need to wrap the plugins in ember js code, but I don't know how to do this. Any help is appreciated!





Aucun commentaire:

Enregistrer un commentaire