因此,我正在個人網站上工作,並且在定位時遇到了一些問題。動畫調整窗口調整大小的多個div
http://i.imgur.com/tFvvnFN.png
理想的情況下,這是想我什麼該網站看起來像。然而,現在,無論何時調整窗口大小,彈出主中心圖像的按鈕都不會保留。我想解決這個問題的方法是將所有應該放在1,000px窗口中的東西都設置好,然後在加載時觸發一個函數,並隨時調整大小以將按鈕('resize size' - 1000)像素向左移動。
如果有人能幫助解決這個問題,或者指出這些代碼出錯的地方,我會非常感激。
相關的HTML;
<div class = "mobile">
<div id= "titlehead">
<img src = "./images/Tilehead.png" alt="headtitle">
</div>
<div id= "illustrationb">
<a href = "Illustrations.html">
<img src = "./images/IllustrationBanner.png"
onmouseover="this.src='./images/Bannerc-1.png'"
onmouseout="this.src='./images/IllustrationBanner.png'"></a>
</div>
<div id= "aboutb">
<a href = "Illustrations.html">
<img src = "./images/Banner-4.png"
onmouseover="this.src='./images/Bannerc-4.png'"
onmouseout="this.src='./images/Banner-4.png'"></a>
</div>
<div id= "photob">
<a href = "Illustrations.html">
<img src = "./images/Banner-3.png"
onmouseover="this.src='./images/Bannerc-2.png'"
onmouseout="this.src='./images/Banner-3.png'"></a>
</div>
<div id= "infob">
<a href = "Illustrations.html">
<img src = "./images/Banner-2.png"
onmouseover="this.src='./images/Bannerc-3.png'"
onmouseout="this.src='./images/Banner-2.png'"></a>
</div>
</div>
jquery;
$(document).ready(function){
var $xMove = window.width - 1000
var $mobile = $('.mobile')
if(window.width > 1000){
$($mobile).animate({
left: "+=" + $xMove
})
}
}
$(window).resize(function){
var $xMove = window.width - 1000
var $mobile = $('.mobile')
if(window.width > 1000){
$($mobile).animate({
left: "+=" + $xMove
})
}
}
http://jsfiddle.net/W67CL/。我還沒有在線上傳圖片。如果能幫助更多的話,我可以把他們扔到imgur上。 把它們定位到目前爲止還沒有用過。 – dMoriarty