整理钢笔背景图到样式表中,js调用css来实现背景图片加载

This commit is contained in:
Argo-Lenovo 2016-12-20 01:04:10 +08:00
parent b5fc54b55b
commit 905675b81b
3 changed files with 7 additions and 3 deletions

View File

@ -548,7 +548,6 @@ ul.breadcrumb {
bottom: 40px; bottom: 40px;
right: 0; right: 0;
top: 94px; top: 94px;
background-image: url('../images/bg.jpg');
overflow: hidden; overflow: hidden;
} }
@ -557,3 +556,8 @@ ul.breadcrumb {
height: 100%; height: 100%;
border: none; border: none;
} }
.welcome-bg {
background-image: url('../images/bg.jpg');
background-size: 100% 100%;
}

View File

@ -1,5 +1,5 @@
$(function () { $(function () {
$('#main-content').css('backgroundImage', 'url("../content/images/bg.jpg")'); $('#main-content').addClass('welcome-bg');
function resposive() { function resposive() {
var height = $(window).height(); var height = $(window).height();
if (height > 672) if (height > 672)

View File

@ -9,5 +9,5 @@
@section header { @section header {
@Html.Partial("Header", Model) @Html.Partial("Header", Model)
} }
<div id="content" class="content-body"> <div id="content" class="content-body welcome-bg">
</div> </div>