Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here is a code to auto change images(say ,after 5 seconds) in Galleria module.
function slideit() { $.galleria.next(); setTimeout("slideit()",5000); } slideit();Put this javascript code in the Galleria modules galleria.tpl.php file and you can see the automatically changing big images.
Comment | File | Size | Author |
---|---|---|---|
#6 | galleria-admin-autoslide_settings.patch | 1.09 KB | davemybes |
#6 | galleria-template-autoslide_settings.patch | 711 bytes | davemybes |
Comments
Comment #1
naim shaikh CreditAttribution: naim shaikh commentedIf you are using jCarousel module with Galleria then here is a code to switch main image through jCarousel next and previous arrows:
Go to modules/jcarousel/jcarousel/lib files and search jquery.jcarousel.js file.
In this file find these 2 lines(line 177,178):
this.funcNext = function() { self.next(); };
this.funcPrev = function() { self.prev(); };
Replace these lines with the following code:
this.funcNext = function() { $.galleria.next(); };
this.funcPrev = function() { $.galleria.prev(); };
Comment #2
BeatnikDude CreditAttribution: BeatnikDude commentedThanks, I have used your javascript code works good. It would be nice to have options available via the settings; the option, the timer and perhaps the transition speed.
Comment #3
naim shaikh CreditAttribution: naim shaikh commentedThanks BeatnikDude,
Really the team of Galleria should implement these features in the next version.So that Galleria will be the ultimate choice for picture Galleries.
Comment #4
jj37fr CreditAttribution: jj37fr commentedComment #5
BeatnikDude CreditAttribution: BeatnikDude commented@jj37fr the above is javascript, and should be placed in the javascript portion of the file.
Comment #6
davemybes CreditAttribution: davemybes commentedI was just looking for this option, and ended up creating a patch for this. There are two patches, one for the admin settings page, and one for the template file. Of course, you can simply copy and paste the template file into your theme folder and add the javascript from the original post to it, but having a settings page might be simpler for some people.
I think a "pause on hover" option would be great too, in case people want to stop and look at an image. I don't know how to do this, so I'll leave it up to someone else for now.
Comment #7
synesis CreditAttribution: synesis commentedIn reply to incrn8 (I thought I clicked reply to your comment, but I obviously didn't)...
This code worked great, but we had to add a timer reset when some clicked the next or previous buttons. If we had a 5 second delay, and clicked next, we would only see the new image for 2 seconds before the image automatically changed.
In the galleria.tpl.php I took your code and turned it into this:
Then in jquery.galleria.js we modified the next and previous functions to the following (Begining line 363):
We didn't make any changes to your admin code.
Hopefully this helps someone else.
Comment #8
BLOK Man CreditAttribution: BLOK Man commentedHi
New member subscribing.
Thanks to both 'incrn8' & 'synesis' for the above. Have added the feature to our new site [in development]. Looks good.
One question....can the "transition rate" of the main image be slowed down. By "transition rate"...I mean the speed at which the main image fades/dissolves & is replaced, as opposed to the time delay between the images scrolling/changing.
At the moment...my images flash in & out a little too quickly.
Thnx
Comment #9
clau_bolson CreditAttribution: clau_bolson commentedThis was just what I was looking for,
The only problem I found is that when the page was loaded the big image wasn't displayed, but I managed to fix it making the delay time bigger.
Thanks.
Comment #10
youlikeicecream CreditAttribution: youlikeicecream commentedI noted on the main page for this module that the developer is looking for co-maintainers and that the development status for this project is idle. Galleria is a great slideshow module, works well and is nice and simple. The auto-transition should be a natural development for this project and should have a settings page.
Why not become a co-maintainer and contribute those patches?
Mike :)
Comment #11
Jumoke CreditAttribution: Jumoke commentedIn incrn8, amazing patch! Thank you :)
Yes, it would be nice to have the "pause on hover" option. Can anyone help with this please?
Comment #12
bcobin CreditAttribution: bcobin commentedGosh - this is wonderful. Looks like the patch applied nicely to dev version and I did the mods in #7 - looking good!
Thanks so much for this - subscribing in the hopes of "pause on hover." Am I getting greedy? Yes!
Seriously, thank you... great work.
Comment #13
miro_dietikerThis is nice. Thank you.
As a Co-Maintainer, my primary focus is D7 (that's why we started as a co-maintainer and provided a port).
If you help us to port it to Drupal 7, i'll do the maintenance work like test, review, commit. However, D7 is the feature branch, so features in D7 first please.
Comment #14
drupalina CreditAttribution: drupalina commentedpatches in comment #6 work perfectly! Awesome!!! Thanks incrn8!!!
The modifications in comment #7 by synesis still don't reset the timer! More work needed there.
I'd say this patch should definitely go into CVS -- very useful.
+1 for the "pause on hover" request by @Excalibur in comment #11 or, maybe some kind of play/pause buttons on the large foto.
My greatest worry at this stage is to be able to change the TRANSITION EFFECTS to something like FADE or SLOW-FADE. With this autoplay, it seems as if the images are "jumping" and after a while it hurts the eyes, and definitely distracts the end-user from reading the content below -- not good for the end-user. So, can we _please_ have an ability to change the transition effects?
Once again, Thanks!
Comment #15
kroimon CreditAttribution: kroimon commentedI'm currently working on a complete rewrite of the configuration screen (see #1185248: Better options page and per-page options).
With that, it should be possible to use all the options Galleria provides, including the autoplay and pauseOnInteraction settings and the transition and initialTransition settings.
Comment #16
drupalina CreditAttribution: drupalina commentedThanks kroimon!
Just a note... there is also a small bug with the new patches here that needs to be taken into account: when the autoplay is on, and you scroll down the page to read the content, once the picture changes, the page jumps back to the top. This happens in Chrome, but not in Firefox.
Comment #17
dufferin CreditAttribution: dufferin commentedthe patch works beautiful.
But really without a pause over function the feature is useless.
Put yourself in the end user skin, like it should be everytime a module is written... do you really think it is useful not to have the option to stop on an image to look at it as much as the end user wants?
It will be ported to 7, but so far it's not.
And in my case I have no way to upgrade to 7 since I use modules that are not yet ready for 7 if ever.
That's the main thing that can bother me with drupal in general. Lack of end user in mind. It's not a rant just an observation to see things moving forward the right direction.
Galleria has a huge potential.