我已经在这个手风琴上工作了几天,当我认为我接近结束时,还有其他事情发生了。首先,我是CSS和JQuery的新手,因此,我不擅长快速识别代码中可能缺少的内容,也可能没有内容。我已经做到了这一点,基本上,我试图为手风琴编写一个完整的“模板”,然后在正确配置时添加准确的内容。在坚果壳中,我只是复制并粘贴当前内容以确保手风琴正常工作。它不是。我想,我需要知道如何使面板更大,以允许更多的内容。我的最终目标是在每个面板中放置四个图像(徽标)以及与该徽标对齐的4-6个文本链接。第4小组尽可能接近我正在寻找的东西,但是,我无法添加我想要的第4张图像。我猜这是一个大小的东西但是,我不确定如何改变它。第3小组不允许我添加任何其他内容。它目前只有1张图片。我添加另一个图像,没有任何显示。 SO的一些人非常慷慨地帮助我开始使用我的代码,似乎每个人都对我的代码进行了一些更改。换句话说,我尝试将代码从Panel 4复制并粘贴到Panel 3,手风琴就变得扭曲了。我只是试图允许每个面板中的4个图像和最小文本内容相应地对齐。我知道这很多,但我想尽可能具体。非常感谢您的时间和任何可能提供的帮助。
FIDDLE:http://jsfiddle.net/CzE3q/1008/
CSS:
#accordion {
width:100%;
margin:10px auto;
border:1px solid black;
-webkit-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4);
-moz-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4);
box-shadow:0px 1px 3px rgba(0, 0, 0, 0.4);
}
#accordion h2 {
clear: both;
cursor:pointer;
margin:0px 0px;
padding:7px 15px;
border:1px solid white;
background-color:#080808;
font:bold 22px Petua One;
color:#ffffff;
text-shadow:0px 1px 0px rgba(0, 0, 0, 0.4);
}
#accordion .content1 {
background-color:#ffffff;
padding:10px 15px;
color:black;
height:230px;
width:25%;
float:left;
}
#accordion h2.active {
background-color:#ff6600;
}
.content-wrapper {
display: inline-block;
}
.content-wrapper a {
display: block;
}
HTML:
<div id="accordion">
<h2><a href="" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/RTH%20Artwork/RTHNeoLogo10_zps4b3f5604.png" width="25" height="25" border="0" alt=" photo RTHNeoLogo10_zps4b3f5604.png"/></a> League Scores</h2>
<div class="content">
<div class="content1"><a href="http://www.pahockey.com">Pittsburgh Amateur<br> Hockey League</a><a href="http://s1314.photobucket.com/user/RTH13/media/Association%20Logos/PAHL210210_zps694744b9.png.html" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/Association%20Logos/PAHL210210_zps694744b9.png" height="100" width="100" border="0" alt=" photo PAHL210210_zps694744b9.png"/></a>
<br><a href="http://www.pahockey.com">Squirt</a>
<br><a href="">Pee Wee</a><br><a href="">Bantam</a>
</div>
<div class="content1"><a href="http://www.pahockey.com">High Performance<br> Hockey League</a>
<br><a href="http://s1314.photobucket.com/user/RTH13/media/Association%20Logos/HPHL_zps31e66fcd.png.html" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/Association%20Logos/HPHL_zps31e66fcd.png" width="90" height="90" border="0" alt=" photo HPHL_zps31e66fcd.png"/></a><br><a href="http://www.pahockey.com">Squirt</a>
<br><a href="">Pee Wee</a><br><a href="">Bantam</a>
</div>
</div>
<h2><a href="" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/RTH%20Artwork/RTHNeoLogo10_zps4b3f5604.png" width="25" height="25" border="0" alt=" photo RTHNeoLogo10_zps4b3f5604.png"/></a> League Standings</h2>
<div class="content">
<div class="content1">Pittsburgh Amateur Hockey League <a href="http://s1314.photobucket.com/user/RTH13/media/Association%20Logos/PAHL210210_zps694744b9.png.html" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/Association%20Logos/PAHL210210_zps694744b9.png" height="100" width="100" border="0" alt="Pittsburgh Amateur Hockey League - Pittsburgh, PA" title="Pittsburgh Amateur Hockey League - Pittsburgh, PA"/></a>
<br><a href="http://www.pahockey.com">Squirt</a><br>Pee Wee
</div>
</div>
<h2><a href="" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/RTH%20Artwork/RTHNeoLogo10_zps4b3f5604.png" width="25" height="25" border="0" alt=" photo RTHNeoLogo10_zps4b3f5604.png"/></a> Tournament Scores</h2>
<div class="content"><a href="http://s1314.photobucket.com/user/RTH13/media/bff3d1c7-f51d-42b7-98e4-240bfe796619_zpse0bc7d8e.jpg.html" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/bff3d1c7-f51d-42b7-98e4-240bfe796619_zpse0bc7d8e.jpg" height="100" width="100" border="0" alt="OneHockey - Laguna Hills, CA" title="OneHockey - Laguna Hills, CA"/></a>
<br><a href="http://www.pahockey.com">Minnesota Gone Wild"</a>
</div>
<h2><a href="" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/RTH%20Artwork/RTHNeoLogo10_zps4b3f5604.png" width="25" height="25" border="0" alt=" photo RTHNeoLogo10_zps4b3f5604.png"/></a> Tournament Standings</h2>
<div class="content">
<div class="content-wrapper"><a href="http://s1314.photobucket.com/user/RTH13/media/bff3d1c7-f51d-42b7-98e4-240bfe796619_zpse0bc7d8e.jpg.html" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/bff3d1c7-f51d-42b7-98e4-240bfe796619_zpse0bc7d8e.jpg" height="100" width="100" border="0" alt="OneHockey - Laguna Hills, CA" title="OneHockey - Laguna Hills, CA"/></a><a href="http://www.pahockey.com">Minnesota Gone Wild<br>Texas Longhorn Shootout</a>
</div>
<div class="content-wrapper"><a href="http://s1314.photobucket.com/user/RTH13/media/Banner%20Ads/NSTESLogo_zps7c937049.png.html" target="_blank"><img src="http://i1314.photobucket.com/albums/t563/RTH13/Banner%20Ads/NSTESLogo_zps7c937049.png" width="100 height="100" border="0" alt=" photo NSTESLogo_zps7c937049.png"/></a><a href="http://www.pahockey.com">Blizzard Challenge<br>Presidents Day Tournament</a>
</div>
Blizzard Challenge </div>
JS:
$(function () {
$('#accordion .content').hide();
//$('#accordion h2:first').addClass('active').next().slideDown('slow');
$('#accordion h2').click(function () {
if ($(this).next().is(':hidden')) {
$('#accordion h2').removeClass('active').next().slideUp('slow');
$(this).toggleClass('active').next().slideDown('slow');
}
});
});