move API to bottom

This commit is contained in:
afc163 2015-08-19 11:26:30 +08:00
parent 8ff9059316
commit 00a0f7b2b0
4 changed files with 28 additions and 18 deletions

View File

@ -17,5 +17,6 @@
{%- if post.meta.template === 'component' && !post.meta.nodemos %} {%- if post.meta.template === 'component' && !post.meta.nodemos %}
{%- include "demos.html" %} {%- include "demos.html" %}
{%- endif %} {%- endif %}
<div class="api-container markdown"></div>
</section> </section>
{% endblock %} {% endblock %}

View File

@ -8,7 +8,7 @@
</a> </a>
{%- endif %} {%- endif %}
</h2> </h2>
<div class="code-boxes clearfix"> <div class="code-boxes">
{%- set items = resource.pages|find_demo_in_component(post.meta.directory) %} {%- set items = resource.pages|find_demo_in_component(post.meta.directory) %}
{%- if post.meta.cols == 1 %} {%- if post.meta.cols == 1 %}
<div class="code-boxes-col-1-1"> <div class="code-boxes-col-1-1">

View File

@ -33,19 +33,24 @@ $(function() {
$(this).parent().parent().addClass('expand'); $(this).parent().parent().addClass('expand');
} }
}); });
$.easing['jswing'] = $.easing['swing'];
$.extend($.easing,{ // 移动 API 文档到演示下方
easeInCirc: function (x, t, b, c, d) { $('.markdown #api').nextAll().andSelf().appendTo('.api-container');
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
}, $.easing['jswing'] = $.easing['swing'];
easeOutCirc: function (x, t, b, c, d) { $.extend($.easing,{
return c * Math.sqrt(1 - (t=t/d-1)*t) + b; easeInCirc: function (x, t, b, c, d) {
}, return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
easeInOutCirc: function (x, t, b, c, d) { },
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; easeOutCirc: function (x, t, b, c, d) {
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
} },
}); easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
}
});
var navFunc = { var navFunc = {
navStrArr: [], navStrArr: [],
init: function() { init: function() {
@ -117,22 +122,22 @@ $(function() {
var title = self.listBox.find("h4"); var title = self.listBox.find("h4");
title.bind("click", function(e) { title.bind("click", function(e) {
var parent = $(this).parent(), var parent = $(this).parent(),
list=parent.find("ul"); list=parent.find("ul");
if (parent.attr("open")) { if (parent.attr("open")) {
parent.removeAttr("open"); parent.removeAttr("open");
if (parent.index() == self.num) { if (parent.index() == self.num) {
$(this).addClass("current"); $(this).addClass("current");
} }
list.animate({marginTop:-list.height()},400,"easeInOutCirc",function (){ list.animate({marginTop:-list.height()},400,"easeInOutCirc",function (){
list.css({"display":"none"}) list.css({"display":"none"})
}) })
} else { } else {
parent.attr("open", true); parent.attr("open", true);
if (parent.index() == self.num) { if (parent.index() == self.num) {
$(this).removeClass("current"); $(this).removeClass("current");
} }
list.css({"display":"block","margin-top":-list.height()}); list.css({"display":"block","margin-top":-list.height()});
list.animate({marginTop:0},400,"easeInOutCirc") list.animate({marginTop:0},400,"easeInOutCirc")
} }
//parent.find("ul").slideToggle(300); //parent.find("ul").slideToggle(300);
}); });

View File

@ -1671,6 +1671,10 @@ footer ul li > a {
color: #3B4357; color: #3B4357;
} }
.code-boxes {
overflow: hidden;
}
.code-boxes-col-1-1 { .code-boxes-col-1-1 {
width: 80%; width: 80%;
} }