Boris Guéry
Boris Guéry

Reputation: 47614

Does the 'explode' effect has a maximum for the number of exploded blocks?

$('#global').show("explode", { number: 50}, 2000);

I tried this code but it doesn't seem to work properly. It looks like it's limited i never got more than 8/10 exploding blocks.

Are there a maximum ? Any ideas ?

the explode effect is a native effect from the jquery-ui

Upvotes: 2

Views: 1893

Answers (3)

TStamper
TStamper

Reputation: 30374

A jQuery Effects Cheat sheet shows to uses pieces instead of number

Upvotes: 2

great_llama
great_llama

Reputation: 11749

I think the option you need to pass in is 'pieces', not 'number'.

$('#global').show("explode", { pieces: 50}, 2000);

Upvotes: 3

Dmitri Farkov
Dmitri Farkov

Reputation: 9681

Just checked out the code.

var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;

There does not seem to be a limit on the number of pieces. This statement just checks if you have passed in a number of pieces and if yes calculates rows and cells, otherwise it defaults to 9 pieces.

With 50 pieces being passed in, going through the calculation of Round(SquareRoot(50)); we get 7 rows and 7 columns. That should result in 49 pieces.

Upvotes: 2

Related Questions