修改帮助的浮动边框

This commit is contained in:
z9hang 2014-11-14 17:35:07 +08:00
parent 3fd1f77535
commit ae19532601
4 changed files with 34 additions and 13 deletions

View File

@ -20,13 +20,13 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var XX=800; // 浮动层的X坐标,即左边距 var XX=1300; // 浮动层的X坐标,即左边距
var xstep=1; // 移动步长此参数越小移动越平滑最小值为1 var xstep=1; // 移动步长此参数越小移动越平滑最小值为1
var delay_time=60; // 每步的时间间隔,此参数越小,移动速度越快 var delay_time=60; // 每步的时间间隔,此参数越小,移动速度越快
var YY=0; var YY=0;
var ch=0; var ch=0;
var oh=0; var oh=0;
var yon=0; var yon=1;
var ns4=document.layers?1:0 var ns4=document.layers?1:0
var ie=document.all?1:0 var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0 var ns6=document.getElementById&&!document.all?1:0
@ -36,18 +36,18 @@
floatpoint.style.top=YY; //将浮动层位置调整到页面底部 floatpoint.style.top=YY; //将浮动层位置调整到页面底部
} }
else if (ns4){ else if (ns4){
YY=window.innerHeight; //由innerHeight取得页面的高度 YY=window.innerHeight; //由innerHeight取得页面的高度
document.floatpoint.pageY=YY; //将浮动层位置调整到页面底部 document.floatpoint.pageY=YY; //将浮动层位置调整到页面底部
document.floatpoint.visibility="hidden"; //将浮动层隐藏。 document.floatpoint.visibility="hidden"; //将浮动层隐藏。
} }
else if (ns6){ else if (ns6){
YY=window.innerHeight //由innerHeight取得页面的高度 YY=window.innerHeight //由innerHeight取得页面的高度
document.getElementById('floatpoint').style.top=YY //将浮动层位置调整到页面底部 document.getElementById('floatpoint').style.top=YY //将浮动层位置调整到页面底部
} }
YY = 0;
function reloc1(){ function reloc1(){
if(yon==0){YY=YY-xstep;} //如果当前应该上移则减小YY值
else{YY=YY+xstep;} //否则增加YY值下移
if (ie){ if (ie){
ch=document.body.clientHeight; ch=document.body.clientHeight;
oh=floatpoint.offsetHeight; oh=floatpoint.offsetHeight;
@ -61,6 +61,14 @@
oh=document.getElementById("floatpoint").offsetHeight //取浮动层的高度 oh=document.getElementById("floatpoint").offsetHeight //取浮动层的高度
} }
if(yon==0)
{
YY=YY-xstep;
} //如果当前应该上移则减小YY值
else
{
YY=YY+xstep;
} //否则增加YY值下移
if(YY<0){yon=1;YY=0;} //如果浮动层超出了上界,则设定移动方向为向下;并设定层的位置为正好在上界处 if(YY<0){yon=1;YY=0;} //如果浮动层超出了上界,则设定移动方向为向下;并设定层的位置为正好在上界处
if(YY>=(ch-oh)){yon=0;YY=(ch-oh);} //如果浮动层超出了下界,则设定移动方向为向上;并设定层的位置为正好在下界处 if(YY>=(ch-oh)){yon=0;YY=(ch-oh);} //如果浮动层超出了下界,则设定移动方向为向上;并设定层的位置为正好在下界处
if(ie){ //如果是IE if(ie){ //如果是IE
@ -72,9 +80,12 @@
document.floatpoint.pageY=YY+window.pageYOffset; //用.pageY设定浮动层上边距 document.floatpoint.pageY=YY+window.pageYOffset; //用.pageY设定浮动层上边距
} }
else if (ns6){ //如果是NS6 else if (ns6){ //如果是NS6
document.getElementById("floatpoint").style.left=XX // document.getElementById("floatpoint").style.left=XX
document.getElementById("floatpoint").style.top=YY+window.pageYOffset // document.getElementById("floatpoint").style.top=YY+window.pageYOffset
$("#floatpoint").offset({left:XX});
$("#floatpoint").offset({top:YY+window.pageYOffset});
} }
} }
function onad(){ function onad(){

View File

@ -1,4 +1,4 @@
<%= render 'course_ad' %>
<% if @events_by_day != nil && @events_by_day.size >0 %> <% if @events_by_day != nil && @events_by_day.size >0 %>
<div class="content-title-top-avtive"> <div class="content-title-top-avtive">
<p class="subtitle"> <p class="subtitle">

View File

@ -24,6 +24,7 @@
</head> </head>
<!--add by huang--> <!--add by huang-->
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
<%= render 'course_ad' %>
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20141103065703) do ActiveRecord::Schema.define(:version => 20141105012624) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -95,19 +95,21 @@ ActiveRecord::Schema.define(:version => 20141103065703) do
create_table "bids", :force => true do |t| create_table "bids", :force => true do |t|
t.string "name" t.string "name"
t.string "budget", :null => false t.string "budget", :null => false
t.integer "author_id" t.integer "author_id"
t.date "deadline" t.date "deadline"
t.text "description" t.text "description"
t.datetime "created_on", :null => false t.datetime "created_on", :null => false
t.datetime "updated_on", :null => false t.datetime "updated_on", :null => false
t.integer "commit" t.integer "commit"
t.integer "reward_type" t.integer "reward_type"
t.integer "homework_type" t.integer "homework_type"
t.integer "parent_id" t.integer "parent_id"
t.string "password" t.string "password"
t.integer "is_evaluation" t.integer "is_evaluation"
t.integer "proportion", :default => 60 t.integer "proportion", :default => 60
t.integer "comment_status", :default => 0
t.integer "evaluation_num", :default => 3
end end
create_table "boards", :force => true do |t| create_table "boards", :force => true do |t|
@ -480,6 +482,13 @@ ActiveRecord::Schema.define(:version => 20141103065703) do
t.integer "project_id", :default => 0 t.integer "project_id", :default => 0
end end
create_table "homework_evaluations", :force => true do |t|
t.string "user_id"
t.string "homework_attach_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "homework_for_courses", :force => true do |t| create_table "homework_for_courses", :force => true do |t|
t.integer "course_id" t.integer "course_id"
t.integer "bid_id" t.integer "bid_id"