我使用了一些 Javascript 从网页底部向上滑动 DIV,并且尝试将其定位在绝对底部中心。
底部的 DIV 似乎在左下角,无论浏览器窗口大小如何,我都试图让它居中。
我会查看这个 URL 以查看相关页面:http ://s361608839.websitehome.co.uk/oneonly/index.html
HTML:
<div class="slide-out-div">
<a class="handle" href="http://link-for-non-js-users">Content</a>
<a href="mailto:name@domain.com">name@domain.com</a><br /><br />
<p>Address</p>
<p>Telephone</p>
</div>
CSS:
.slide-out-div {
padding: 20px;
width: 276px;
background: url(images/kontakt-bg.png);
color: #fff;
}
JS:
$(function(){
$('.slide-out-div').tabSlideOut({
tabHandle: '.handle', //class of the element that will be your tab
pathToTabImage: 'images/kontakt-tab.png', //path to the image for the tab (optionaly can be set using css)
imageHeight: '26px', //height of tab image
imageWidth: '316px', //width of tab image
tabLocation: 'bottom', //side of screen where tab lives, top, right, bottom, or left
speed: 300, //speed of animation
action: 'click', //options: 'click' or 'hover', action to trigger animation
fixedPosition: false //options: true makes it stick(fixed position) on scroll
});
});
谢谢!