I recently rebuild the header of my website ( http://www.phermann.bplaced.net/new ). It now features a slider called Glide.js ( http://jedrzejchalubek.com/glide/ ). Everything is fine now as I got help in the CSS forums with the positioning and stuff, but I really want to change the sliding effect to a simple fade.
Since my JS skills are pretty bad I would like to have some help on how to find the section that is responsible for the sliding effect and what to change there.
Please excuse the harsh loading times caused by the pictures that are not edited for web yet.
These sliders are usually pretty complex, so it’s best to check first if they have built-in settings for changing this kind of behavior. In this case, the slider docs don’t indicate an option for changing from slide to fade, so honestly, I’d look for one that does have it as an out-of-the-box feature. There are lots of these things out there.
I had a look at the slider in question and it seems that some other people wanted this feature.
If you check out that page, you can see that the plugin author added this as a milestone for a future release, then removed it again a month later. No idea why.
This in turn got me thinking about how one could add fade in/out functionality to the plugin, so I did.
You can see a demo here.
If you would like to play around with this, you can get the altered code here.
I would however add, that I pretty much crowbarred this feature into the existing code, just to see if it would work. It needs quite a bit of tidying up, so would still recommend that you do what Ralph says and look for a slider that supports this out of the box.
I actually really don’t want to switch from Glide, so I would appreciate your alternative code then. If you improve it later on I could simply update the code then. I mean my website does not have 10 visitors per week so it wouldn’t be a drama if we would test the new feature. Although it should be working on Chrome, Firefox, Safari.
What critical downsides do I get when using your alternative sliding effect now?
You’re welcome.
You don’t actually get any downsides apart from the fact that background images now fade and do not slide.
What caused me the biggest headache was the circular option, as that did loads of weird stuff, such as remove event handlers.
When I get a bit of time (ha ha!) I might look at cleaning this up a little, so that you can specify slide or fade as a transition type. At the moment only fade works.
Its me again .
I copied the new javascript into my files and then changed the html and css. Now the header is completely broken and I don’t know what to do to fix it. For me it looks like the Javascript is either not installed correctly or the slider didn’t start proper.
Thanks for the help and the code alteration for the fade effect
I uploaded the current status here.