Jump to content

javascript print not printing correctly


diasansley

Recommended Posts

here is my code it is a js function popup!! for printing the data i get . Now as per the current code if i click on print in the preview it shows me the parent content in the background as well! IS there a way to this!

 

function popUp(){

                document.getElementById('light').style.display='block';
                document.getElementById('fade').style.display='block';
                //var formData = document.getElementById('profile_info').innerHTML;
                var formData = "<div class='tabconten_1'>";
                formData = formData + "<a  id='closemenupop' href='javascript:close();' ></a>";
                formData = formData + "<div id='logo1'></div></div>";
                formData = formData + "<div class='tabconten_1'></div>";
                formData = formData + "<div class='tabconten_1'>"+document.getElementById('profile_info').innerHTML+"</div>";
                formData = formData + "<div class='tabconten_1'></div>"; 
                formData = formData + "<div class='tabconten_1'></div>";
                formData = formData + "<a class='searchbtn1' href='javascript:window.focus();window.print();' >Drucken</a>";
                document.getElementById('light').innerHTML = formData ;
                //popUp_second();

                                                             
            }
<div id="light" class="white_content"> 
</div>
<div id="fade" class="black_overlay"></div>

 

Thanks

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.