Results 1 to 5 of 5

Thread: Printing pages with Animated Collapsible DIV

  1. #1
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Printing pages with Animated Collapsible DIV

    1) Script Title:
    Animated Collapsible DIV v2.4

    2) Script URL (on DD):
    Animated Collapsible DIV v2.4

    3) Describe problem:

    I was trying to make a personalized print button, but i seen that the divs from Animated Collapsible are not showing on prints...
    What should i do?
    This is the script i am using:

    Code:
    <script type="text/javascript">
    
    function printSelection(node){
      var content=node.innerHTML
      var pwin=window.open('','print_content','width=100,height=100');
      var elem=document.getElementById("printme").innerHTML;
       pwin.document.open();
      pwin.document.write('<html><body onload="window.print()">'+elem+'</body></html>');
      pwin.document.close();
      setTimeout(function(){pwin.close();},1000);
    }
    </script>
    printme - the name of the principal div
    printme is a table which contains all the toggled divs with the "display: none;" propriety...

    i tried to print you page with Animated Collapsible DIV v2.4 and it's the same thing...doesn't sees the hidden divs...

    This is the printing button:
    Code:
    <a href="" onclick="printSelection('elem');return false">print</a>
    Thanks for the help!!!!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The easiest way is just to use CSS's print media to force all DIVs to be visible when the page is printed, using something like:

    Code:
    <style type="text/css">
    
    @media print{
    	div{
    	display:block !important;
    	}
    }
    
    </style>
    Use your browser's "Print Preview" feature to see if the DIVs are in fact visible when printed.
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    pilotvtm (12-06-2009)

  4. #3
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    just tried that..doesn't work...i don't know why (google that command and seems to be working in other cases;not in mine)..


    EDIT:
    it works now, but it doesn't show when printing the background or the border or the div color (can divs be changed, just on printing??; and another thing, the divs need to be opened when printing) :

    Code:
    @media print {
        div1 {display:block important!; overflow: auto !important; background: #ffffcc;border: solid;}
       div2 {display:block important!; overflow: auto !important; background-color: #ffffcc;border: solid;}
     .....
    }
    Last edited by pilotvtm; 12-05-2009 at 10:42 PM.

  5. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I'm confused, since you say it works now, but that:

    the divs need to be opened when printing
    Isn't that what you mean when you say it works, or if not, what does (and doesn't)?
    DD Admin

  6. The Following User Says Thank You to ddadmin For This Useful Post:

    pilotvtm (12-06-2009)

  7. #5
    Join Date
    Dec 2009
    Posts
    9
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    i believed, the divs don't need to be toggled to see them when printed..
    that's what i tried to make...but it's ok with them like this.(only if the divs are toggled (display: block) they can be seen on prints)
    it's good that they work...
    thanks for your help!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •