Hi
I would like to have java script "image preloading" effect and "fading in" effect on image page. This effect looks beautyfull when I enable option "Use Galleriffic script" in my zpArdoise theme but I want to have it only on image page. I don't like layout of galleriffic.
Any idea where I have to look in image.php and what to add in code ? Please give me something for start.
Comments
First I had to download script from this page:
http://www.splintered.co.uk/experiments/64/
More informations abut this script you can find on:
http://clagnut.com/sandbox/imagefades/
http://hungred.com/how-to/tutorial-how-does-image-fade-in-when-picture-loaded/
I implemented the javascript mentioned by mironb. It works but I lose color box in the process. How do I use the cycle plugin to do this? Can you point me in the right direction?
Meanwhile, I've already found the link to its website:
```http://jquery.malsup.com/cycle/`
Is it as simple as quoting a function like this one in a script?
```$('#fade').cycle();`
Appreciate your feedback.
If you like to replace the default image page with its next/prev you have to rework your theme to do so.
Here's what I'm using IAW the demo of how to fade in the first picture from their website:
``$(function() {
$('#slideshow img:first').fadeIn(1000, function() {
$('#slideshow').cycle();
});
});``
I've inserted this code on image.php and changed the id of the image accordingly:
```printCustomSizedImageMaxSpace(getBareImageTitle(), 650, 450, false, 'slideshow')`
So next I'm thinking well I've got to hide it first with css, and then fadeIn (or .'show'), I've tried the following all successfully hiding the image, but it never appears:
``
$('#slideshow').css('opacity','0');
$('#slideshow').css('visibility','hidden');
$('#slideshow').css('display','none');
I haven't figured it out yet... but I can make the image "appear" with this:
`` $(function() {
$('#slideshow').css('visibility','hidden');
});
$(window).load(function() {
$('#slideshow').css('visibility','visible')
});
``
All I'm missing now is the "fade in" or ```show('slow')`...
Still eager for your input. thanks
If it is possible, as suggested to mironb, I would like to do replace the javascript with whatever the cycle plugin can do, and that way regain the color box functionality.
``
/javajs/imageloader.js">
``
This is how I was referencing the script, minus the /script tag. I noticed that when I moved it below the color box script in the head section, my page failed to load at all. So I changed it, and things are working as expected.
I'd still like to know how to use the cycle plug in for this though...
For the first you have to rework the theme to bypass the default next/prev by using a slider script (This is basically what the galleriffic script does internally as far as I remember). Also the carousel requires another setup.
If you just want the 2nd then hid the image via CSS intitially and fade it in via jQuery fadeIn(). No need for any image loader in this case. Why load the image via js if it is loaded via plain html already.
``
$(document).ready(function() {
$('#thephoto').css('display','none');
$(window).scrollTop(250); *\-->optional, hashtag anchor works too...
});
$(window).load(function() {
$('#thephoto').fadeIn(1500);
});
``
The final effect simulates the slideshow to near perfection. Thanks again.