下面的代碼只是在視口寬度(var)超過設置寬度時執行一個函數。 var viewportWidth = $(window).width();
function refit__slider__height(){
var fitted__height = $('#promobanner__wrap').height() - 150;
$('#promobanner--slid
HTML <div class="element">
<p>I want to center this element vertically and horizontally.</p>
</div>
CSS .element
{
background: #eee;
border: 1px solid #ccc;
font-size: 24px;