0
I have 5 buttons that open a window using Fancybox modal inline, and the moment I open this window I need to take a parameter or some way to show which was the button that triggered the event:
<a class="btn btn-success fancybox1" href="#divFormaPgto" style="font-size: 22px; width: 100%;" id="btnPtgoDinheiro">F2 - DINHEIRO</a>
<a class="btn btn-primary fancybox2" href="#divFormaPgto" style="font-size: 22px; width: 100%;" id="btnPtgoCheque">F3 - CHEQUE</a>
<a class="btn btn-danger fancybox3" href="#divFormaPgto" style="font-size: 22px; width: 100%;" id="btnPtgoCartaoCredito">F4 - CARTÃO CRÉDITO</a>
<a class="btn btn-info fancybox4" href="#divFormaPgto" style="font-size: 22px; width: 100%;" id="btnPtgoCartaoDebito">F5 - CARTÃO DÉBITO</a>
<a class="btn btn-warning fancybox5" href="#divFormaPgto" style="font-size: 22px; width: 100%;" id="btnPtgoCrediario">F6 - CREDIÁRIO LOJA</a>
<div id="divFormaPgto" style="display: none">
<h1 onclick="alert($.fancybox.FormaPgto);">RECEBIDO</h1>
<div>
</div>
<br />
<a href="javascript:;" onclick="$.fancybox.close();">Close</a>
</div>
.
<script>
$(document).ready(function () {
$('a.fancybox1').fancybox({
'modal': true,
'FormaPgto': 'dinheiro'
});
$('a.fancybox2').fancybox({
'modal': true
});
$('a.fancybox3').fancybox({
'modal': true
});
$('a.fancybox4').fancybox({
'modal': true
});
$('a.fancybox5').fancybox({
'modal': true
});
});
</script>
I was trying to pass this way, but Formapgto always leaves Undefined, would have another more suitable way?
It worked out, buddy, thanks.
– Luciano