我需要从我的数据库中预加载图像,然后将它们显示在 8 x 8 的滑块中。我该怎么做?
<script type="text/javascript">
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
$('<img/>')[0].src = this;
// Alternatively you could use:
// (new Image()).src = this;
});
}
</script>
<script>
preload([HERE HAVE I TO DO THE SELECT FROM MY DATABASE??]);
</script>
滑块是这样的:
<script type="text/javascript">
$(document).ready(function() {
$("#foo1").carouFredSel({
items : 8,
direction : "left",
width : "100%",
scroll : {
items : 1,
easing : "swing",
duration : 300
}
});
$("#foo1_next").click(function() {
$("#foo1").trigger("next", 4);
});
$("#foo1_prev").click(function() {
$("#foo1").trigger("prev", 4);
});
});
</script>
那我该怎么办?
谢谢大家 ;)