jQueryPlugins
jQueryPlugins copied to clipboard
Problem printing more than one element on Firefox
Using firefox 7.0.1 and I'm trying to print multiple element (img tag) from within a loop but only the first one get printed and the iteration stops. In IE, it seems to work.
Here is the relevant code :
[code]
$('#printImage').click(function() { $("link[media='print']").attr("href", "/css/print.css"); pdfFileNameLst = new Array();
$('img[id^="pdfToPrint"]').each(function(index) {
a = $(this).attr("id").split("_");
pdfFileNameLst[index] = a[1];
});
pdfFileNameLst = pdfFileNameLst.sort();
for (i=0; i<pdfFileNameLst.length; i++) {
$("#pdfToPrint_" + pdfFileNameLst[i]).printElement();
}
});
[/code]