【发布时间】:2015-02-02 22:43:57
【问题描述】:
单击 authJoinType 模板中的 .join-type-heading 类后,我想呈现(显示)joinForm 模板。此外,我正在尝试像这样为 joinForm 设置动画(查看它淡入和向上移动的方式)。 http://jsfiddle.net/blackhawx/kMxqj/13/
我应该将 joinForm 模板嵌套在 authJoin 模板中吗?
HTML:
<template name="authJoin">
{{> authJoinType}} // this template displays two boxes with labels 'publisher' and 'reader'
{{> joinForm}} // this to fade into view when either box is clicked
</template>
<template name="authJoinType">
<div class="container join-type">
<div class="row">
<div class="col-md-6">
<a href="#">
<div class="join-type-heading" value="reader">Reader</div></a>
</div>
<div class="col-md-6">
<a href="#">
<div class="join-type-heading" value="publisher">Publisher
</div></a>
</div>
</div>
</div>
</template>
<template name="joinForm">
<div class="container">
<div class="row-fluid">
<div class="col-md-6">
<div class="wrapper-auth">
<form class="form-join">
<input type="text" class="form-control" id="firstName" placeholder="first name" required="" autofocus="" />
<input type="text" class="form-control" id="lastName" placeholder="last name" required="" autofocus="" />
<input type="text" class="form-control" id="email" placeholder="email address" required="" autofocus="" />
</form>
</div>
</div>
</div>
</div>
</template>
client.js 用于点击事件(这很好)
Template.authJoinType.events({
'click div.join-type-heading': function(e, tmpl) {
//function to go here....
}
});
我试图在点击事件时在 joinForm jquery 中附加 html,但这不起作用。 例如
$('#container').append('<div>....</div>');
我正在使用 mizzao:bootstrap-3 和 mizzao:jquery-ui。
【问题讨论】:
标签: jquery meteor jquery-animate iron-router