Comments (12)
The centering will not work if you are specifying an absolute position in your
image
transition. Can you please post the classes you are using to define the
transitions
and the JS you are using to initialize the show?
Original comment by [email protected]
on 13 May 2008 at 1:58
from slideshow.
I am using the exact same setup as the default CSS file.
Original comment by [email protected]
on 14 May 2008 at 7:35
from slideshow.
I modified the show function to be able to handle absolute positioning. But this
removes the flexibility of customizing a css class.
I found another bug also. The image is not centered on initialize. The first
image is
always set to 0,0.
show: function(fast){
if (!this.image.retrieve('morph')){
var options = (this.options.overlap) ? {'duration': this.options.duration, 'link':
'cancel'} : {'duration': this.options.duration / 2, 'link': 'chain'};
$$(this.a, this.b).set('morph', $merge(options, {'transition':
this.options.transition}));
}
//this._center(this.image);
var hidden = this.classes.get('images', ((this.direction == 'left') ? 'next' :
'prev'));
var visible = this.classes.get('images', 'visible');
if (fast)
this.image.get('morph').cancel().set(visible);
else {
var img = (this.counter % 2) ? this.a : this.b;
if (this.options.overlap){
img.get('morph').set(visible);
this.image.get('morph').set(hidden).start(visible);
} else {
var size = this.image.getSize();
var fn = function(hidden, visible){
this.image.get('morph').set(hidden).start({left: (size.x - this.width) / -2,
top: (size.y - this.height) / -2, opacity: 1});
}.pass([hidden, visible], this);
var hidden = this.classes.get('images', ((this.direction == 'left') ? 'prev' :
'next'));
img.get('morph').set({left: (size.x - this.width) / -2, top: (size.y -
this.height) / -2, opacity: 1}).start(hidden).chain(fn);
}
}
},
Original comment by [email protected]
on 14 May 2008 at 8:30
from slideshow.
Regarding centering on initialize, I haven't found a way to do this as the
image must
be centered after the first image has loaded.
Original comment by [email protected]
on 14 May 2008 at 2:28
from slideshow.
Centering on initialize can be done by adding the following after line 104
(anchor.clone().grab(this.a).inject(images);)of the slideshow.js file:
this._center(this.a);
Original comment by [email protected]
on 15 May 2008 at 9:11
from slideshow.
Thanks for your feedback but this does not work as sometimes the image isn't
loaded
fast enough to be able to set the top and left.
Centering must be done after we have confirmation that the first image has
loaded or
some other CSS solution.
Obviously this works if the image is already loaded, but this scenario does not
work
when you load an image dynamically.
Original comment by [email protected]
on 15 May 2008 at 9:21
from slideshow.
What about centering the first image in your CSS? That seems like the safest
bet.
Original comment by [email protected]
on 15 May 2008 at 9:42
from slideshow.
I tried that without success. Any suggestions on the CSS needed for the first
image?
I also needs to centered vertically.
Original comment by [email protected]
on 16 May 2008 at 8:54
from slideshow.
http://www.google.com/search?q=css+center+vertical
Original comment by [email protected]
on 19 May 2008 at 3:33
from slideshow.
Setting CSS attributes on the first image will cause those attributes to be
duplicated in the "a" and "b" images (those are the names in the code), which
most
likely will have undesired results. For example, I used the old "top: 50%;
left:
50%; width: 400px; height: 300px; margin-left: -200px; margin-top: -150px"
negative
margins trick. This worked great for displaying the first image, but the
subsequent
images had their top and left attributes set to 0, so the negative margins
pushed the
images out of the slideshow window. I imagine other centering techniques would
also
cause the subsequent images to display out of kilter.
It seems whatever solution is found for Defect #10 could also solve this one.
Ultimately, the image to be displayed first, be it the first image or one
specified
by the "slide" option, needs to be completely loaded so that size attributes are
correctly set and the image can then be centered and resized.
Original comment by [email protected]
on 22 May 2008 at 9:51
from slideshow.
Original comment by [email protected]
on 12 Jun 2008 at 10:39
from slideshow.
Testing locally and the patch suggested in comment #5 seems to work. I would
recommend making sure to set
the height and width for the default image in the HTML so the class has the
necessary info to calculate the
centering before the media loads.
Original comment by [email protected]
on 16 Jun 2008 at 12:20
- Changed state: Fixed
from slideshow.
Related Issues (20)
- Slideshows don't work without Javascript
- if i want to make a different slide show style how can i change it?
- Controller controls all slideshows on page HOT 1
- Google fonts + KenBurns
- Vertical scrolling HOT 1
- Google Groups request unanswered HOT 1
- Attempting to download image with mangled name.
- creating a facebook page HOT 1
- get cash for surveys
- Loader and controller fixed on Chrome HOT 1
- Not Working in IE 6
- Thumbnails loading issue in IE9
- Enhancement request: swipe support
- Controller won't dissappear on Chrome
- control not working with random mode
- Firefox behavior in Mac & PC: Inconsistent showing of slideshow HOT 1
- Slideshow not working in IE10
- Slideshow Not Working in Firefox
- [Mootools 1.5.0] Lightbox doesn't work
- Slideshow design program with separated Alpha/Numeric Information
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slideshow.