ndesign11
ndesign11

Reputation: 1779

jQuery fadeIn() doesn't work

I have a simple script but the fadein() part is not working. Not getting any errors though..

$('<ol/>', {
  'class': 'raw-list',
  html: items.join('')
 }).appendTo('.json').fadeIn(1000);
});

Upvotes: 4

Views: 10175

Answers (3)

fdrv
fdrv

Reputation: 890

The trick =)

$('.hidden').fadeTo(300, 1);

Upvotes: 0

adeneo
adeneo

Reputation: 318352

Try to hide it first with the following code :

$('<ol/>', {
  'class': 'raw-list',
  html: items.join('')
})
.hide()
.fadeIn(1000)
.appendTo('.json');

Upvotes: 10

SLaks
SLaks

Reputation: 888223

fadeIn() won't do anything if the element is already visible.

You need to hide() it first.

Upvotes: 7

Related Questions