I have a problem that has already been described here, but I have not found a way to solve it. The problem is that I am using this jQuery fragment for the accordion:
$(document).ready(function() {
$('#accordion > li > div.ac-inner').click(function(){
if(false == $(this).next().is(':visible')) {
$('#accordion ul').slideUp(300);
}
$(this).next().slideToggle(300);
});
});
And with this HTML I load Google Map:
<ul id="accordion">
<li id="acc-1"><div class="ac-inner"><h3>Tab 1</h3></div>
<ul>
<li><div></div></li>
</ul>
</li>
<li id="acc-2"><div class="ac-inner"><h3>Tab 2</h3></div>
<ul>
<li></li>
</ul>
</li>
<li id="acc-3"><div class="ac-inner"><h3>Tab 3</h3></div>
<ul>
<li></li>
</ul>
</li>
</ul>
This is my CSS:
#accordion {
list-style: none;
padding: 0;
width: 527px;
}
#accordion li {
background: none;
padding-left: 0;
}
#accordion div.ac-inner {
display: block;
cursor: pointer;
margin-bottom: 10px;
padding: 0 7px;
border: 1px solid #ddd;
background: #F5F5F5;
background: -moz-linear-gradient(top, #FAFAFA 0%, #F5F5F5 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FAFAFA), color-stop(100%,#F5F5F5));
background: -webkit-linear-gradient(top, #FAFAFA 0%, #F5F5F5 100%);
background: -o-linear-gradient(top, #FAFAFA 0%, #F5F5F5 100%);
background: -ms-linear-gradient(top, #FAFAFA 0%,#F5F5F5 100%);
background: linear-gradient(top, #FAFAFA 0%,#F5F5F5 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FAFAFA', endColorstr='#F5F5F5',GradientType=0 );
border-radius: 5px;
box-shadow: 0 1px 0 #fff inset;
-moz-box-shadow: 0 1px 0 #fff inset;
-webkit-box-shadow: 0 1px 0 #fff inset;
text-shadow: 0 1px 0 #fff;
-moz-text-shadow: 0 1px 0 #fff;
-webkit-text-shadow: 0 1px 0 #fff;
}
#accordion ul {
list-style: none;
padding: 0 0 0 0;
}
#accordion ul {
display: none;
}
#accordion ul li {
font-weight: normal;
cursor: auto;
background-color: #fff;
padding: 0 0 0 7px;
}
#accordion a {
text-decoration: none;
}
#accordion a:hover {
text-decoration: underline;
}
#accordion #acc-1 div.ac-inner {
background: url(../images/icons/map.png) no-repeat 0 0 #F5F5F5;
text-indent: 70px;
}
#accordion #acc-2 div.ac-inner{
background: url(../images/icons/calendar.png) no-repeat 0 0 #F5F5F5;
text-indent: 70px;
}
#accordion #acc-3 div.ac-inner {
background: url(../images/icons/camera.png) no-repeat 0 0 #F5F5F5;
text-indent: 70px;
}
Google says this is a problem due to the display of the CSS rule: none; therefore, the map is partially displayed (with gray blocks) and is not centered.
Is it possible to simply adapt the top jQuery snippet to make it work, or will I need to touch the download of the Google Map script (which is loaded dynamically through the CMS plugin)?