我刚刚使用了 bigspotteddog 的 ScrollToFixed 插件
(https://github.com/bigspotteddog/ScrollToFixed)
在我的网站上
(http://faiththeagency.com/easyphone/frequently-asked-questions.php) *更新的网站,所以插件工作
基本上从我可以看到这个插件直接在我的#float-cta div 下方插入一个具有这些属性的div:
<div style="width: 354px; height: 457px; float: none; display: none; "></div>
这导致我的布局发生变化和跳跃,任何人都知道为什么会这样吗?
这是我的代码。
<div id="float-cta">
<img src="img/phone.gif" />
<h2>Call us on: 0800 085 2761</h2>
<p class="f13">Lines are open 9.00am – 5.00pm,<br /> Monday to Friday.</p>
<img src="img/store.gif" />
<h2>Go in store</h2>
<p class="f13">The Age UK Shop is located in Peterborough town centre: <span class="bold">25 Westgate, Peterborough, PE1 1PZ</span>. <span class="italic">Age UK Limited is acting as our<br /> in-store sales agent. All contracts are with CyCell Limited.</span></p>
<a href="easyphone_order_form.pdf" class="block nul"><img src="img/form.gif" />
<h2 class="ul">Download an order form</h2>
<p class="f13">Click here to download the order form. <br />Fill it in and post it in a stamp addressed envelope to <span class="bold">EasyPhone, PO Box 70812, London, NW1W 8ZA</span></p></a>
<img src="img/letter.gif" />
<h2>Email order form</h2>
<p class="f13">Scan and email your completed order form<br /> to <a href="mailto:info@cycell.com">info@cycell.com</a></p>
</div>
jQuery
$('#float-cta').scrollToFixed();
CSS
#float-cta {
position:absolute;
width:322px; height:395px;
background-color:#00853e;
margin: 30px 0 0 0;
color:#FFFFFF;
font-size:14px/16pt;
padding: 16px;
right:39px;
}
#float-cta.fixed {
position:fixed;
top: 0;
}
#float-cta p {
margin: 0 0 22px 52px;
}
#float-cta img {
float:left;
margin: 0 9px 0 0;
}
我会整天都在回答任何问题,并在此先感谢。