[jQuery] Re: hide divs with float:left and show them again

2009-08-20 Thread Mauricio (Maujor) Samy Silva
When you remove a floated element from the flow of a document its position is 
occupied by the next float and this
causes the ruin! To preserve the space leaving by a removed div how about use:
css('visibility', 'hidden'); istead of show()

Maurício
  -Mensagem Original- 
  De: simusch 
  Para: jQuery (English) 
  Enviada em: quinta-feira, 20 de agosto de 2009 16:56
  Assunto: [jQuery] hide divs with float:left and show them again



  Hi

  I have a site with a lot of small div-boxes (with images and movies
  within them)
  they are positioned with CSS and float:left.

  i created buttons, which show and hide either all images or all movies
  this works well.

  but when i switch between these options, the float-position of the
  divs goes crazy and every div-container is on one line for itself
  (instead of 5 on one line)

  does someone have an idea, how i can solve this problem?

  simon

[jQuery] Re: hide divs with float:left and show them again

2009-08-20 Thread Kevin

Is the layout broken initially or only after you hide/show the
content? When you inspect the DIVs in Firebug, do they still have
their float properties assigned? Are you specifying a width on the
boxes? Posting example code always helps other developers troubleshoot
your issues faster =)

On Aug 20, 3:56 pm, simusch inview...@gmail.com wrote:
 Hi

 I have a site with a lot of small div-boxes (with images and movies
 within them)
 they are positioned with CSS and float:left.

 i created buttons, which show and hide either all images or all movies
 this works well.

 but when i switch between these options, the float-position of the
 divs goes crazy and every div-container is on one line for itself
 (instead of 5 on one line)

 does someone have an idea, how i can solve this problem?

 simon