问题
I am just a designer and don't know javascript well enough to figure out how to print a full content of a JScrollPane, not a visible part of it. I would very much appreciate any help with the issue. Thanks!
回答1:
I'd suggest creating a print-stylesheet that contains following rules:
div.jScrollPaneContainer {
position: static !important;
height: auto !important;
overflow: visible !important;
}
div.jScrollPaneContainer > * {
display: none !important;
}
div.scroll-pane {
position: static !important;
display: block !important;
float: none !important;
}
all selectors used in the code above correspond to HTML structure of jScrollPane basic example
回答2:
Didn't work for me with jScrollPane - v2.0.0beta11 - 2011-07-04. Taking a quick look at the generated source code shows that the div class names have changed. Here is what I put in my print.css:
div.booksummary,
div.booksummary > div {
position:static !important;
height: auto !important;
overflow: visible !important;
}
where the jQuery code is:
$('.booksummary').jScrollPane();
Another thought : Putting CSS properties in @media print {} only works if the CSS file in question is loaded, which won't happen if the CSS file is associated to the 'screen' media.
回答3:
Or put the entire scrollpane stylesheet inside a
@media print
{
//scrollpane css goess here.
}
来源:https://stackoverflow.com/questions/2570906/how-to-print-a-full-content-of-jscrollpane