Thanks helped a lot. An added note. For Firefox the
$('div.pics a').each(function() { $(this).css({left: '50%', marginLeft: -$(this).width()/ 2}); }); needs to happen before you start the cycle plugin. Otherwise for some reason only the first photo is centered. On Mar 14, 8:56 am, caruso_g <[EMAIL PROTECTED]> wrote: > Hi Rick, > thanks a lot for your reply. > The problem is that auto margins don't work since the elements are > absolute positioned. > The absolute positioning is necessary to let elements be one on the > other one when animating. > > The good new is that I found the solution. > I know that for all the devs out there is stupid but to me it took > half day of work and attempts... :P > > Here it is my solution: > > $('div.pics a').each(function() { > $(this).css({left: '50%', marginLeft: -$(this).width()/2}); > }); > > If someone wants to comment it, or if it could be improved in any way, > I would love to read your posts. > > Thank you all again. > > On Mar 14, 2:24 pm, Rick <[EMAIL PROTECTED]> wrote: > > > Well you can try using: > > margin-left:auto; > > margin-right auto; > > this does not work in msie, but in msie you can do a expression > > left:50% > > elm.style.setExpression("marginLeft","-"+this.parentNode.offsetHeight/ > > 2") > > > On 14 mrt, 12:57, caruso_g <[EMAIL PROTECTED]> wrote: > > > > May anyone help me, please? > > > Mike...? > > > > Thank you all! > > > > On Mar 13, 10:49 pm, caruso_g <[EMAIL PROTECTED]> wrote: > > > > > Hi all guys, > > > > I have a problem with the fantastic Cycle plugin. > > > > I have a group on images links whose I can't know their dimensions in > > > > advance. > > > > So the images sizes the customer will use will vary. > > > > The Cycle plugin give the element an absolute positioning (so left 0 > > > > and top 0). > > > > Since I need to center those images link in their container, I have > > > > the problem to dynamically know their width to give the image link a > > > > left position 50% and a left-margin -"the-image-size"/2 just to center > > > > it. > > > > Well, as you can see, I can say it in words, but sadly I am not able > > > > to translate it in jQuery language. > > > > Can someone help me? And above all, can try to explain me the "modus > > > > operandi" on how to arrive to the code? I would like to learn the > > > > "pattern" to find these kind of solutions and be able to do it myself. > > > > Btw, thanks to Remy Sharp the author of jQuery For Designers[http:// > > > > jqueryfordesigners.com/] he is quite prefect in his tutorial, and > > > > above all doesn't jump any step, and show us the code verbose before > > > > to short it! Great resource! > > > > > This is the online example > > > > page:http://www.bonsai-studio.net/clients/lamoy/wessel04/speed/ > > > > > Thanks to anyone that can help me.