php - CSS 图像减速

标签 php css performance image

我有以下 CSS

    .jScrollPaneContainer {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.jScrollPaneTrack {
    position: absolute;
    right: 50%;
    top: 0;
    height: 100%;
}
.jScrollPaneDrag {
    position: absolute;
    overflow: hidden;
}
.jScrollPaneDragTop {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}
.jScrollPaneDragBottom {
    position: absolute;
    bottom: 0;
    left: 0;
    overflow: hidden;
}
.scroll-pane {
    width: 100%;
    height: 100%;
    display:block;
    overflow: auto;
}
a.jScrollArrowUp {
    display: block;
    position: absolute;
    z-index: 1;
    top: 0;
    right: 50%;
    text-indent: -2000px;
    overflow: hidden;
    height: 9px;
}

a.jScrollArrowDown {
    display: block;
    position: absolute;
    z-index: 1;
    bottom: 0;
    right: 50%;
    text-indent: -2000px;
    overflow: hidden;
    height: 9px;
}
.jScrollPaneTrack {
    background: url(/images/track.gif) repeat-y;
}
.jScrollPaneDrag {
    background: url(/images/drag_middle.gif) no-repeat 0 50%;
}
.jScrollPaneDragTop {
    background: url(/images/drag_top.gif) no-repeat 0 0;
    height: 4px;
}
.jScrollPaneDragBottom {
    background: url(/images/drag_bottom.gif) no-repeat 0 0;
    height: 4px;
}
a.jScrollArrowUp {
    height: 11px;
    background: url(/images/arrow_up.gif) no-repeat 0 0;
    cursor:default;
}
a.jScrollArrowUp:hover {
    background-position: 0 -11px;
}
a.jScrollArrowDown {
    height: 11px;
    background: url(/images/arrow_down.gif) no-repeat 0 0;
    cursor:default;
}
a.jScrollArrowDown:hover {
    background-position: 0 -11px;
}
a.jScrollActiveArrowButton, a.jScrollActiveArrowButton:hover {
    background-position: 0 -22px;
}

这是我在 html 头部的经典 asp 代码中加载 css 样式表的地方:

    <link href="/css/jScrollPane.css" type="text/css" rel="stylesheet" media="all" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.mousewheel.js"></script>
<script type="text/javascript" src="/scripts/jScrollPane.js"></script>
<script type="text/javascript">
$(function()
{
// this initialises the demo scollpanes on the page.
$('#pane1').jScrollPane({showArrows:true, scrollbarWidth:11, scrollbarMargin:0});
$('#pane2').jScrollPane({showArrows:true, scrollbarWidth:11, scrollbarMargin:0});
$('#pane3').jScrollPane({showArrows:true, scrollbarWidth:11, scrollbarMargin:0});
$('#pane4').jScrollPane({showArrows:true, scrollbarWidth:11, scrollbarMargin:0});
$('#pane5').jScrollPane({showArrows:true, scrollbarWidth:11, scrollbarMargin:0});
$('#pane6').jScrollPane({showArrows:true, scrollbarWidth:11, scrollbarMargin:0});
});
</script>
<script>

有人可以向我解释为什么加载拖动*.gif 和上下箭头 gif 需要大约 50 秒吗?我真的很困惑为什么加载简单的图像需要这么长时间。这可能是缓存问题吗?这是我从网页上获得的结果的图片。

enter image description here

enter image description here

最佳答案

多个 HTTP 请求确实会减慢网页加载时间。看看this CSS sprites tutorial了解如何显着提高速度。

关于php - CSS 图像减速,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6792939/

相关文章:

html - div 和 float 图像之间的空间

asp.net - CSS Problems : Advertise over 2 divs, 布局问题

javascript - 如何使导航回到顶部透明

c++ - 矩阵乘法速度问题

php - Mysql:计算有多少行有一个或多个特定关键字

php - 我可以强制子类使用父类的构造函数吗?

php - fetch_assoc() 在循环中仅工作一次

PHP-EWS "Soap client returned status of 404"

c++ - 减轻 openmp 并行延迟的措施

JavaScript 性能 : Multiple script blocks Vs single bigger block