diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb index 0f233465..faff9e13 100644 --- a/app/views/layouts/_base_footer.html.erb +++ b/app/views/layouts/_base_footer.html.erb @@ -1,31 +1,31 @@
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index c91b3e45..0e45ab3b 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -1,22 +1,11 @@ <%= stylesheet_link_tag 'welcome' %> - - -
-

问题和反馈动态 diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 7a241981..e41260de 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -1,22 +1,11 @@ <%= stylesheet_link_tag 'welcome' %> - - -
-
- - - - - - - - -






- -
-
- -
+

diff --git a/public/javascripts/welcome.js b/public/javascripts/welcome.js new file mode 100644 index 00000000..a0166bb3 --- /dev/null +++ b/public/javascripts/welcome.js @@ -0,0 +1,64 @@ +(function () { + window.onload = function(){ + function fixedBar(id, options){ + var ele = document.getElementById(id); + if(!ele) return; + if(/msie (\d+\.\d+)/i.test(navigator.userAgent)){ + var pageHeight=window.innerHeight; + var d=document; + if(typeof pageHeight!="number"){ + if(document.compatMode=="CSS1Compat"){ + pageHeight=document.documentElement.clientHeight; + }else{ + pageHeight=document.body.clientHeight; + } + } + var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop; + if(options.addclass) ele.className = options.addclass; + ele.style.position= 'absolute'; + + if(options.show){ + ele.style.top = 0 + "px"; + ele.style.display= 'block'; + } + + window.attachEvent('onscroll' , function (){ + + var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop; + + ele.style.top = 0 + "px"; + if(options.autoHidden){ + if(ieScrollTop==0){ + ele.style.display="none"; + }else{ + ele.style.display="block"; + } + } + }); + }else{ + var ele = document.getElementById(id); + if(typeof pageHeight!="number"){ + if(document.compatMode=="CSS1Compat"){ + pageHeight=document.documentElement.clientHeight; + }else{ + pageHeight=document.body.clientHeight; + } + } + if(options.show) ele.style.display= 'block'; + ele.style.top = 0 +'px'; + window.addEventListener('scroll',function (){ + if(options.autoHidden){ + if(baidu.page.getScrollTop()==0){ + ele.style.display="none"; + }else{ + ele.style.display="block"; + } + } + },false); + } + } + + fixedBar('backTopBtn' , {autoHidden: true, top : 186}); + fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true}); + } +})(); \ No newline at end of file