I am grabbing divs using the .each function, but I am having trouble passing the ID I get to my modal box function. Here is the code:
(function() {
$('div.heriyah').each(function() {
$(this).html('<div class="add"><div id="add_button_container"><div id="add_button" class="edit_links">+ ADD NEW CONTENT</div></div></div><div class="clear"></div><div class="placeable"></div></div>');
$('.add').click(function() {
$.fallr('show', {
content : '<iframe width="620" height="600" src="<? echo $URL ?>/manage_content.php?id=<? echo $pageID; ?>&div='+$(this).attr('id')+'"></iframe>',
width : 620 + 5, // 100 = for width padding
height : 600,
closeKey : true,
closeOverlay : true,
buttons : {}
});
});
});
})();
I get Undefined if I request the variable inside my modal box.
I use this:
'+$(this).attr('id')+'
To grab the id inside my modal box function.
Thanks,
Drummer
I’m not sure what
fallris but try changing your code to this: