javascript - Preload images from database -


i need preload images database , show them in slider 8 8. how can it?

<script type="text/javascript">                 function preload(arrayofimages) {                 $(arrayofimages).each(function(){                 $('<img/>')[0].src = this;                 // alternatively use:                 // (new image()).src = this;     }); }             </script> <script>  preload([here have select database??]); </script> 

the slider this:

<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> 

what have then?

thanks ;)

you can have prefetch link relation so:

<link rel="prefetch" href="location/of/image.png" /> 

this recommended here: http://davidwalsh.name/html5-prefetch used slideshows.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -