Closed (won't fix)
Project:
Views cycle
Version:
6.x-1.0-beta1
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Jun 2009 at 20:00 UTC
Updated:
21 Jan 2010 at 23:20 UTC
Hi,
I case anybody was wanting a way to pre-load the images before the views cycle jquery voodoo kicks in you can put the following into the "Header" field under "Basic Settings" for your view:
<?php
drupal_add_js(
'$(document).ready(function() {
$(".views-cycle-container").hide();
vCycleImages = setInterval(function() {
var bImgLoaded = true;
var images = $(".views-cycle-container img");
for (var i = 0; i < images.length; i++) {
var img = images[i];
if (img.complete == false)
bImgLoaded = false;
}
if (bImgLoaded) {
$(".views-cycle-container").show("normal");
clearInterval(vCycleImages);
}
}, 1000);
}); ' , 'inline' );
?>
Make sure you set the input format to PHP. This is a first crack at a preloader and it suits my needs. It would be cool to figure out how to put a little spinning wheel in there.
Enjoy,
Michael
Comments
Comment #1
eabrand commentedThis would be good to put into the documentation.
Comment #2
Crell commentedImages are all presented at once anyway, so I don't see the need for a preloader.