bmoren / jQuery-Generative-Engines

Generative Engines for jQuery Projects
MIT License
1 stars 1 forks source link

.iterate and .replicate should be compressed #3

Closed bmoren closed 8 years ago

bmoren commented 8 years ago

perhaps .iterate and .replicate should be compressed into the .replicate() method with an option to toggle between stepping and forlooping for the generation. the new method described above should become .replicate()

<img class='image' src='cool.jpg'>

<!-- include jQuery and plugin before -->
<script type="text/javascript">

  $('.image').replicate({
      total:100,
      random: true,
      mode: 'once', // modes: once, step | once is for a single forloop to generate all the appends once, step would be the old .iterate() method wrapped into this one. these names are not final, do you have a better idea?
      speed: 500, // optional speed atribute for single step, only works in ... mode
  }); // creates 100 copies of cool.jpg in random places on the screen.

</script>