2014-11-21 3 views
0

스크립트로 인해로드 된 내용에 따라 내 페이지의 컨텐츠 div를 확장하려고합니다. 나는 내가 아는 모든 것과 내가 인터넷에서 발견 한 모든 것을 시도했지만, 나는 원하는 결과를 얻지 못했다.내용에 따라 div를 확장하십시오.

HTML :

<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>index</title> 
<link href="styles.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script> 
<script type="text/javascript"> 
$(function(){ 
$('#nav a').click(function(e) { 
$('#content').hide().load($(this).attr('href') , function(){ 
$('#content').show() 
}) 
return false 
}) 
}) 
</script> 
</head> 
<body> 
<div id="container"> 
    <div id="header"></div> 
    <div id="nav"><a href="home.html">Home</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <a href="the_band.html">The Band</a>&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp; 
    <a href="News.html">News</a> &nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <a href="gallery.html">Gallery</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Merchandise&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    <a href="contact.html">Contact</a></div> 
    <div id="content"></div> 
    <div id="footer"></div> 
</div> 
</body> 
</html> 

CSS :

div#container { 
height: 100%; 
width: 100%; 
} 
div#header { 
top: 0px; 
width: 100%; 
height: 80px; 
position: fixed; 
background-color: transparent; 
text-align: center; 
} 
div#nav { 
font-family: MgSouvenirLight; 
font-size: 18pt; 
color: #FF0; 
top: 120px; 
width: 100%; 
height: 40px; 
position: fixed; 
text-decoration: none; 
text-align: center; 
font-weight: bolder; 
font-variant: normal; 
} 
div#content { 
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; 
font-size: 12px; 
position: absolute; 
top: 200px; 
bottom: 40px; 
left: 200px; 
right: 200px; 
} 
div#footer { 
font-family: Arial, Helvetica, sans-serif; 
font-size: 9px; 
bottom: 0px; 
position: fixed; 
height: 30px; 
width: 100%; 
text-align: center; 
color: #fff; 
} 
.ttdesign { 
font:"Arial Black", Gadget, sans-serif; color: #09F; 
} 
a:link { 
font-family: MgSouvenirLight; 
font-size: 18pt; 
color: #FF0; 
} 
a:visited { 
font-family: MgSouvenirLight; 
font-size: 18pt; 
color: #FF0; 
} 
a:hover { 
font-family: MgSouvenirLight; 
font-size: 18pt; 
font-style: italic; 
color: #FC0; 
} 

데모 링크는 다음과 같습니다 http://thodoris.esy.es/is/

지금 발생하는 문제는로드 된 내용이 없다는 것입니다 #content를 펼치지 만로드가 넘는 것 같습니다. 어떤 아이디어가 있습니까?

+0

here이 페이지에로드되는 방법을 보여주는 몇 가지 무료 템플릿이 있습니다 얻을 수 ...? –

+0

내용이 비어 있습니다. –

+0

$ ('# content'). ($ (this)) .attr ('href'), function() {$ ('# content'). '아무 것도로드하지 않고 .. '

' –

답변

0

페이지를 응답 성있게 만들려면 그리드 시스템을 사용할 때 부트 스트랩을 사용하는 것이 더 좋을 수 있습니다. 콘텐츠 및 화면 크기에 따라 페이지의 모든면을 반응 적으로 만들 수 있습니다.

당신은 here

그리고 여기가 모두 함께 맞는 내가 어떤 콘텐츠를 볼 수 없습니다

+1

그는 컨텐츠를 제대로 div에 채우기 위해 프레임 워크를 사용할 필요가 없습니다 ... –

관련 문제