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. :)
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
Posting Komentar
terimakasih komentarnya