erikzaadi / jQueryPlugins

Collection of jQuery plugins
83 stars 88 forks source link

Problem printing more than one element on Firefox #26

Open hudony opened 13 years ago

hudony commented 13 years ago

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]