javascript - Fancybox initiated element -


i have grid in displaying multiple deals. each deal has multiple sub deals. have display sub deals in fancybox popup of respective deal on click event. have store deal id in data attirbute of anchor element. stuck when sending ajax request cannot pass respective deal id since unable element clicked. here code:

$('.deal_parent').fancybox({     href    : subdealurl,     ajax : {         type        : "get",         data        : 'deal='+{here want pass deal id dynamically},     },     'overlayopacity'    : '0.2',     'transitionin'      : 'elastic',     'transitionout'     : 'fade', }); 

i have tried passing $(this).data('deal') there doesnt worked.

try invoking fancybox differently, e.g.:

$('.deal_parent').click( function () {     // can use $(this)     $.fancybox({         href    : subdealurl,         ajax : {             type        : "get",             data        : 'deal='+$(this).data('deal'),         },         'overlayopacity'    : '0.2',         'transitionin'      : 'elastic',         'transitionout'     : 'fade',     }); }); 

i haven't tested it, code may need adjustments.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -