我用一些JavaScript,其滑動從網頁底部的DIV了,我一直在努力,絕對底部中心位置的。絕對定位不工作的Javascript DIV
底部的DIV似乎是左下角,我已經試過有它爲中心,不管瀏覽器窗口大小是什麼。
我想看看這個網址,看到有問題的網頁: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:[email protected]">[email protected]</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
});
});
謝謝!
我希望這有助於http://stackoverflow.com/questions/210717/using-jquery-to-center-a-div-在屏幕上 –