fancybox making function condition

Hello guys,
I would to share about making function. You can take condition on your fancybox. In my case:
I have checkbox that should be checked to show the fancybox.

<pre>
<script type="text/javascript">
  $("#invitation-message").fancybox({
    'onStart': function()
    {
      var $list_friends = $('input[id^="friends"][type="checkbox"]:checked');
      var condition_friend = $list_friends.length
      if (condition_friend > 0) {
         alert('a')
      } else {
        alert('b')
      }  
    }  
  });
</script>
</pre>


Hopefully this article to be useful. :)

Komentar

Postingan populer dari blog ini

EPrT English Proficiency Test Soal - soal

cara memunculkan dan menyembunyikan icon date, time, clock, volume, network, power battery, action center pada taskbar pada Windows 7