zoelaw / slideshow

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

New Option: Direct display of first image #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

1. (boolean  default: true)
2. true: First image displays directly with no transition.
3. false: First image displays with transition.

Original issue reported on code.google.com by daiv.mow...@gmail.com on 11 Sep 2009 at 8:53

GoogleCodeExporter commented 9 years ago
I implemented this feature by adding the image in the background of the div 
container via CSS, which isn't are very good solution but it works for most 
cases.

Do you can give any details when this feature will be implemented?

Original comment by sabri.ka...@googlemail.com on 5 Aug 2010 at 1:01

GoogleCodeExporter commented 9 years ago
Added a new value for the "fast" option to Slideshow in Github:

- fast: 0 = always transition
- fast: 1 = always transition when the user navigates the slideshow except for 
when it is paused
- fast: 2 = never transition when the user navigates the slideshow
- fast: 3 = never transition when the user navigates the slideshow and don't 
transition for first image

Original comment by aeron.gl...@gmail.com on 18 Apr 2011 at 1:10

GoogleCodeExporter commented 9 years ago
I think this is a great feature... at http://www.ambientphotography.ca ... the 
slideshow "blinks" when it first loads as the slideshow transitions to the 
first slide.... which is also the default image.

Great work!

Original comment by jason%he...@gtempaccount.com on 18 Apr 2011 at 1:54

GoogleCodeExporter commented 9 years ago
Great news aeron,

that you add this feature, but I also have to say that I see an image on the 
first load.

Thanks anyway!

Original comment by websupp...@fauth-gundlach.de on 18 Apr 2011 at 2:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I downloaded the source from github. I found that fast=3 works as advertised, 
removing the transition between the default image and first slide.

BUT there was still a flash between the default image and first slide. so i 
went hunting in the code.

i found removing this line from function initialize got rid of the flash:
  this.a.set('styles', {'display': 'none'});

is display:none necessary? the blanking out of the this.a causes the blink. i 
see no need for it, whether fast is set or not.

also occasionally there is a brief flash of white border on the img.. along 
with the title... not sure the source of that but i will keep hunting. possibly 
css.

See http://www.ambientphotography.ca/ for a live example with the code change 
above.

Original comment by jason%he...@gtempaccount.com on 18 Apr 2011 at 5:01

GoogleCodeExporter commented 9 years ago
Is it possible to insert the default image as the first slide of the slideshow? 
That way Slideshow could seamlessly transition into the show, even if the 
default image is different than the first image in the show.

Original comment by jason%he...@gtempaccount.com on 18 Apr 2011 at 6:59

GoogleCodeExporter commented 9 years ago
I guess I feel there are some things the script shouldn't assume... like
that the default image is part of the show and will be visible when
navigating the show or when the show loops... the issue with all this is
that even if the default image is also the first slide, when it is presented
in the slideshow it may appear different than the static html image
depending on resize/center options and type of show (kenburns, etc). For
that reason I thought having the first image transition on was the simplest,
most elegant solution. If you think there's a better way though I'd
definitely reconsider a better approach.

Original comment by aeron.gl...@gmail.com on 18 Apr 2011 at 8:22

GoogleCodeExporter commented 9 years ago
you're absolutely right.

Original comment by jason%he...@gtempaccount.com on 18 Apr 2011 at 9:49

GoogleCodeExporter commented 9 years ago
re: comment 2, what if the transition for user navigation is desired, but 
transition for the first image is NOT desired? Combining this behavior with the 
"fast" option may not be the best solution. OP's original idea of creating a 
new option may be better... a new option just for handling the way the first 
image loads.

re: comment 6, i've found that this code is necessary when a default image is 
in place and can't be arbitrarily removed:
this.a.set('styles', {'display': 'none'});

but this code could be removed if OP's new option was set to true.

1. (boolean  default: false for backwards compatibility)
2. true: First image displays directly with no transition. this.a style is not 
altered during initialize.
3. false: First image displays with transition.

Original comment by jason%he...@gtempaccount.com on 26 Apr 2011 at 6:48

GoogleCodeExporter commented 9 years ago
Ok. I changed this a bit. It should be backwards compatible... but in the 
future you can set the fast option by mixing and matching constants with a bit 
of bit shifting cleverness.

New constants:

WhenPaused (equivalent to fast = 1)
OnUserControl (equivalent to fast = 2)
OnStart (equivalent to fast = 3)

And usage is as so:

fast = WhenPaused;
fast = WhenPaused | OnUserControl;
fast = WhenPaused | OnUserControl | OnStart;
fast = OnUserControl | OnStart;
fast = WhenPaused | OnStart;

etc etc... So should make things clearer, allow for a bit more customization 
and be more flexible going into the future. Will be in tonight's build.

Original comment by aeron.gl...@gmail.com on 9 May 2011 at 2:05

GoogleCodeExporter commented 9 years ago
OnUserControl became WhenPlaying, otherwise same idea.

Original comment by aeron.gl...@gmail.com on 9 May 2011 at 2:16