AltynbekKZ / galleriffic

Automatically exported from code.google.com/p/galleriffic
0 stars 1 forks source link

feature: slide change + pause on hover ? #99

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Is there a solution to implement this?
I tried the code change on trent's page concerning Galleriffic 1, but I
think the code in version 2 has changed and the mod is no longer valid.

Fore reminder, here is what Trent answered to this question on his page
about galleriffic 1:

@Cory – In the source of advanced example, you will see I am already
attaching hover over and out events to each thumbnail. You will want to add
some addition code in these events for advancing the gallery. I’ll take a
stab at it below, but I haven’t tested this:

[code] // Initially set opacity on thumbs and add
// additional styling for hover effect on thumbs
var onMouseOutOpacity = 0.67;
$('#thumbs-adv ul.thumbs li').css('opacity', onMouseOutOpacity)
    .hover(
        function () {
            $(this).not('.selected').fadeTo('fast', 1.0);

            // Add these next few lines to show this slide in the gallery on hover
            var index = $(this).find('a.thumb')
                .attr('href')
                .replace(/^.*#/, '');

            $('#gallery-adv').goto((+index));
        }, 
        function () {
            $(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
        }
    );[/code ]

Original issue reported on code.google.com by sguyon...@gmail.com on 15 Apr 2010 at 9:17

GoogleCodeExporter commented 8 years ago
For pausing on hover, I added:

// Auto start the slideshow
if (this.autoStart)
    this.play();

// Auto pause the slideshow
$('#gallery').hover(
    function () {
        gallery.pause();
    },
    function () {
        gallery.play();
    }
);

// Kickoff Image Preloader after 1 second
setTimeout(function() { gallery.preloadInit(); }, 1000);

Autostart and Kickoff parts are already inside jquery.galleriffic.js, between 
them add Auto pause... instead of #gallery use a selector for element you want 
to trigger auto pause. Hope this helps a bit

Original comment by gregor...@gmail.com on 1 Jul 2011 at 10:49

GoogleCodeExporter commented 8 years ago
Is there any way to make the images change on thumbnail hover instead of click? 
 I've searched all over but can't find any jquery image galleries that do this.

Original comment by rmazo...@gmail.com on 6 Aug 2011 at 9:52

GoogleCodeExporter commented 8 years ago
> Is there any way to make the images change on thumbnail hover instead of 
click?

Did you ever manage to figure this out? I am also interested in a solution. 

Original comment by tech%mgr...@gtempaccount.com on 1 Dec 2011 at 10:21

GoogleCodeExporter commented 8 years ago
Hi guys...
i have not studied his code well enough...but a quick test of a very simple 
change will make the code wor with "hover-over" thumbnails.

Edit Line 206 in jquery.galleriffic.js revision 2.0 i believe.  
change:
 .click(function(e) {
To
 .hover(function(e) {

That's it.  it worked for me... 

fawzi

Original comment by fawzima...@gmail.com on 3 Dec 2011 at 8:19

GoogleCodeExporter commented 8 years ago
Worked for me too.  Thanks.

Paul

Original comment by patatech...@gmail.com on 2 Sep 2012 at 12:15

GoogleCodeExporter commented 8 years ago
Thanks for posting this fix.

Original comment by sar...@thelibrary.org on 29 Nov 2012 at 1:47

GoogleCodeExporter commented 8 years ago
// Auto pause the slideshow
$('#gallery').hover(
    function () {
        gallery.pause();
    },
    function () {
        gallery.play();
    }
);

This is buggy when gallery is paused from button: leaving the defined area 
(#gallery), slideshow starts again. Using "if (this.isSlideshowRunning)" does 
not work either, same happens.
We could use a solution, where the Pause action triggered with the button 
cannot be override with a mouseleave event.

So normally if user pauses slideshow with the click, nothing should happen on 
hover for that element.

Any ideeas?

Original comment by szakacs....@gmail.com on 7 Feb 2013 at 6:54