课程、竞赛、项目的主页的上下间距缩小

logo和大学名称的居中对齐,以及搜索条的上下居中。
This commit is contained in:
z9hang 2014-05-17 15:15:33 +08:00
parent cb23b54d01
commit fc1d5baf95
5 changed files with 57 additions and 16 deletions

View File

@ -1,6 +1,6 @@
<!--add by huang-->
<div class="clearfix"></div>
<div id="footer" style="margin-left:-5px;padding-top: 150px;clear: both;font-size: 12px;">
<div id="footer" style="margin-left:-5px;padding-top: 20px;clear: both;font-size: 12px;">
<div style="border-top:solid 1px #C6E9F1;"></div>
<div class="base_footer">
<div align="center">

View File

@ -9,8 +9,23 @@
$(function(){
$("#main").find("a").attr("target", "_blank");
setCss();
});
//设置div居中
function setCss()
{
var mainBar = $('#main-content-bar')[0];
var topHeight = mainBar.offsetHeight;
var welcomeLeft = $('#welcome_left')[0];
var leftHeight = welcomeLeft.offsetHeight;
var searchbar = $('#J_Slide')[0];
var searchHeight = searchbar.offsetHeight;
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
//alert((topHeight - leftHeight)/2 );
}
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
@ -96,12 +111,12 @@
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
<div class="weixin-content">微信扫码</div>
</div>
<div class="main-content-bar">
<div class="main-content-bar" id="main-content-bar">
<!--文字-->
<div style="float: left">
<%= image_tag '/images/transparent.png', size: "75x75" %>
</div>
<div class="welcome_left" >
<div class="welcome_left" id="welcome_left">
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_contest) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_contest_description) %></span>
</div>

View File

@ -5,8 +5,22 @@
$(function(){
$("#main").find("a").attr("target", "_blank");
setCss();
});
//设置div居中
function setCss()
{
var mainBar = $('#main-content-bar')[0];
var topHeight = mainBar.offsetHeight;
var welcomeLeft = $('#welcome_left')[0];
var leftHeight = welcomeLeft.offsetHeight;
var searchbar = $('#search-bar')[0];
var searchHeight = searchbar.offsetHeight;
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
//alert((topHeight - leftHeight)/2 );
}
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
@ -19,13 +33,12 @@
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
<div class="weixin-content">微信扫码</div>
</div>
<div class="main-content-bar">
<div class="main-content-bar" id="main-content-bar">
<div style="float: left">
<%= image_tag(@logoLink, size:'75x75') %>
</div>
<div class="course welcome_left" >
<br />
<div class="course welcome_left" id="welcome_left" >
<span class="font_welcome_school"> <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<% else%>
<% if params[:school_id] == "0" %>
@ -48,7 +61,7 @@
<% end %>
<% end %>
</div>
<div class="search-bar">
<div class="search-bar" id="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
</div>
<div style="clear: both;"></div>

View File

@ -4,8 +4,21 @@
$(function(){
$("#main").find("a").attr("target", "_blank");
setCss();
});
//设置div居中
function setCss()
{
var mainBar = $('#main-content-bar')[0];
var topHeight = mainBar.offsetHeight;
var welcomeLeft = $('#welcome_left')[0];
var leftHeight = welcomeLeft.offsetHeight;
var searchbar = $('#search-bar')[0];
var searchHeight = searchbar.offsetHeight;
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
//alert((topHeight - leftHeight)/2 );
}
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
@ -18,14 +31,14 @@
<%= link_to image_tag('/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" ), home_path %>
<div class="weixin-content">微信扫码</div>
</div>
<div class="main-content-bar">
<div class="main-content-bar" id="main-content-bar">
<div style="float: left">
<%= image_tag '/images/transparent.png', size: "75x75" %>
</div>
<div class="welcome_left" >
<div class="welcome_left" id="welcome_left">
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_project) %></span> <span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_project_description) %></span>
</div>
<div class="search-bar">
<div class="search-bar" id="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
</div>
<div style="clear: both;"></div>

View File

@ -312,11 +312,11 @@ a.attachments_list_color {
}
.main-content-bar{
margin: 0;
margin-top: 35px;
margin-top: 12px;
padding: 0;
margin-bottom: 35px;
width: 100%;
height: auto;
margin-bottom: 2px;
width: 100%;
height: 78;
}
.weixin-content{