修复Zebra手风琴

时间:2014-09-26 16:31:15

标签: javascript jquery css accordion jquery-ui-accordion

我已经按照实施这个简单的jQuery手风琴的说明,然而,它在网页上看起来很乱。如果您转到 Alchemy in Detail 标签,您将看到Zebra手风琴的实际效果。的 http://www.planet.nu/dev/test/product-page.html

它非常混乱,但如果您尝试在网络浏览器(Firefox浏览器Chrome)上打开检查元素,它就会自行修复!但是当你刷新页面时,它将恢复到凌乱的布局。

我不确定我的html是否坏了还是css。



<dl class="Zebra_Accordion">
		<dt>Managed Services</dt>
			<dd>
				<p><span>Alchemy Social’s Managed Service solution works with businesses of all sizes — from brand new start-ups to established multinationals — ensuring that they connect with and engage the right social audiences.</span></p>
				<p>Our teams combine the perfect blend of skills, from traditional digital display through search to creative design. With offices around the world, we manage campaigns and support our clients whenever and wherever they need us:</p>
					<ul class="alchemy-product-list-subnav">
						<li class="alchemy-product-list">Full campaign management, from goal setting/strategy through to delivery and reporting </li>
						<li class="alchemy-product-list">Dedicated Account Managers</li>
						<li class="alchemy-product-list">Targeting and segmentation planning</li>
						<li class="alchemy-product-list">Custom built creative generation on demand (image and copy)</li>
						<li class="alchemy-product-list">Daily optimisation</li>
						<li class="alchemy-product-list">Regular reporting</li>
						<li class="alchemy-product-list">Campaign review</li>
						<li class="alchemy-product-list">Access to Experian’s unique and  proprietary data assets to improve campaigns</li>
					</ul>
			</dd>
		<dt>Licensed Services</dt>
			<dd>
				<p><span>As the social space evolves at tremendous speed, even the most experienced in-house teams can need support to stay ahead of the curve.</span></p>
				<p>Experian’s Alchemy Social Licensed solutions offer flexible, on-demand services to meet every need. Our client services team is amongst the most experienced in the industry, offering scalable support to your social strategies and campaigns.</p>
				<p><span>Alchemy SaaS</span></p>
				<p>Licensing the Alchemy Social Platform brings access to the full range of features of the Facebook ads manager platform, including:</p>
					<ul>
						<li class="alchemy-product-list">Guidance on how to create, manage, report on and optimise campaigns </li>
						<li class="alchemy-product-list">Access to regular webinars on new releases, features and best practices </li>
						<li class="alchemy-product-list">Dedicated account management support and consultative advice </li>
						<li class="alchemy-product-list">Create campaign rules for real-time cost per acquisition (CPA) optimisation</li>
						<li class="alchemy-product-list">Effectively refine activity at various points of the campaign cycle</li>
						<li class="alchemy-product-list">Control ad spend at segment level by location or target group</li>
						<li class="alchemy-product-list">Analyse conversion data and integrate with other analytical tools</li>
						<li class="alchemy-product-list">View real-time reporting to understand CPA and conversion rates at ad level</li>
						<li class="alchemy-product-list">Integrate campaign results with tools like Google Analytics and Adobe Omniture</li>
					</ul>	
				</dd>
		</dl>
&#13;
&#13;
&#13; 这是我的Zebra Accordion的CSS:
&#13;
&#13;
dl.Zebra_Accordion { width: 100%; font-family: Arial, sans-serif; font-size: 12px; }
dl.Zebra_Accordion dt { background: #000; color: #FFF; font-weight: bold; padding: 5px; }
dl.Zebra_Accordion dd { background: #EFEFEF; padding: 15px; margin: 1px 0; }
 
dl.Zebra_Accordion dt.Zebra_Accordion_Expanded { background: #C40000; }
&#13;
&#13;
&#13; 来自Zebra Accordion的jQuery:
&#13;
&#13;
 <script>
$(document).ready(function() {
    var myAccordion = new $.Zebra_Accordion('.Zebra_Accordion', {
        'collapsible':  true
    });
});
</script>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

好吧,既然没有人回答我的问题,我发现我只需要改变CSS。它可能不是那里最好的手风琴,但它适用于jQuery 1.5.2,因为很多手风琴插件都失败了。

dl.Zebra_Accordion { width: 740px; font-size: 14px; }
dl.Zebra_Accordion dt { background: #878787; color: #FFF; font-weight: bold; padding: 8px; 	}
dl.Zebra_Accordion dd { background: #EFEFEF; padding-top: 5px; padding-bottom: 305px; margin: 0; }
dl.Zebra_Accordion dt.Zebra_Accordion_Expanded { background: #0095da; }

此外,jQuery片段效果不佳所以我正在使用这个:

$(document).ready(function() {
  new $.Zebra_Accordion($('.Zebra_Accordion'));
});