var version = '2.2.1'; var sp = location.href.lastIndexOf('/'); var ep = location.href.lastIndexOf('.html'); var curPage = sp < ep ? location.href.slice(sp + 1, ep) : 'index'; var enVersion = (location.hash && location.hash.indexOf('-en') != -1) || location.href.indexOf('-en') != -1; var activeClass = {}; var loc = {}; var forkWidth = 149; curPage = curPage.replace('-en', ''); var isExample = false; switch (curPage) { case 'index' : activeClass[curPage] = 'active'; loc[curPage] = '.'; loc.feature = './doc'; loc.example = './doc'; loc.doc = './doc'; loc.about = './doc'; loc.changelog = './doc'; loc.start = './doc'; loc.img = './doc'; break; case 'feature' : case 'example' : case 'doc' : case 'about' : case 'changelog' : case 'start' : activeClass[curPage] = 'active'; loc.index = '..'; break; default : isExample = true; forkWidth = 60; activeClass['example'] = 'active'; var extSub = location.href.indexOf('extension') != -1 ? '../' : ''; loc.index = extSub + '../..'; loc.feature = extSub + '../../doc'; loc.example = extSub + '../../doc'; loc.doc = extSub + '../../doc'; loc.about = extSub + '../../doc'; loc.changelog = extSub + '../../doc'; loc.start = extSub + '../../doc'; loc.img = extSub + '../../doc'; break; } $('#head')[0].innerHTML = '
' + '' + '' + 'Fork me on GitHub' + '' + '' + '
'; function back2Top() { $("body,html").animate({scrollTop:0},1000); return false; } function changeVersion() { if (!isExample) { window.location = curPage + (enVersion ? '' : '-en') + '.html' } else { window.location = curPage + '.html' + (enVersion ? '' : '#-en'); if (enVersion) { window.location.hash = window.location.hash.replace('-en', ''); } window.location.reload(); } } $('#footer')[0].style.marginTop = '50px'; $('#footer')[0].innerHTML = '
' + '
' + '
' + '

' + (enVersion ? 'Link' : 'ECharts团队出品') + '

' + '' + '
' + '
' + '

' + (enVersion ? 'More' : '更多') + '

' + '' + '
' + '
' + '

' + (enVersion ? 'Contact Us' : '联系我们') + '

' + '' + '
' + '' + '
' + '

Back to top

' + '

© 2015 Baidu

' + '
'; if (document.location.href.indexOf('local') == -1) { var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb78830c9a5dad062d08b90b2bc0cf5da' type='text/javascript'%3E%3C/script%3E")); } function fixFork () { var navMarginRight = 0; var bodyWidth = document.body.offsetWidth; var contnetWidth = $('#nav-wrap')[0].offsetWidth; if (bodyWidth < 1440) { navMarginRight = 150 - (bodyWidth - contnetWidth) / 2; } $('#nav')[0].style.marginRight = navMarginRight + 'px'; $('#fork-image')[0].style.width = (document.body.offsetWidth < 768 ? 1 : forkWidth) + 'px'; }; fixFork(); $(window).on('resize', fixFork);