开发者

Nivo slider misalignment issue only when the site is not loaded from cache

I have this stranger problem on Nivo slider that the images are not centrally aligned instead are right aligned when the page is opened for the first time. A refresh will make use of the cache, and the issue will be开发者_如何转开发 gone but if I Ctrl + F5 it, then again the issue will come up and will be gone on the next reload.

I am suspecting it to be a timing issue in js, that when we get a cache hit, images are already loaded and the Nivo slider aligns the images properly but when the image sizes are not available (cache miss), it does something wrong and slider images are misaligned.

Url - http://wordpress.ashfame.com/

Screenshot:

Nivo slider misalignment issue only when the site is not loaded from cache


If you set your nivo slider to 780px x 425px, which are the size of your images, then it should fix your issues. However, because of the transparancy and the white color of the previous and next buttons you won't be able to locate the navigation arrows easily:

#nivo-slider {
     width: 780px;
     height: 425px;
     margin: auto;
     background: url('images/loading.gif') no-repeat 50% 50%;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜