打印页面时隐藏jquery ui手风琴格式

时间:2021-07-11 19:43:11

I'm trying to create an effective print.css for a running tips page. The page includes a jQuery UI Accordion to display various topics, but I'd like to not show the accordion when printing the page.

我正在尝试为正在运行的提示页面创建一个有效的print.css。该页面包含一个jQuery UI Accordion来显示各种主题,但我不希望在打印页面时显示手风琴。

Here's a screenshot of how it looks when I print.

这是我打印时的外观截图。

打印页面时隐藏jquery ui手风琴格式


When the page is printed, I'd like for it to display as if javascript was disabled, like the following screenshot:

打印页面时,我希望它显示为禁用了javascript,如下面的屏幕截图所示:

打印页面时隐藏jquery ui手风琴格式


The accordion is created with a <div id="gettingStarted_accordion">, so hiding that in the print.css makes the whole section disappear.

手风琴是用

创建的,所以将其隐藏在print.css中会使整个部分消失。

Is there any easy way to do this?

有没有简单的方法来做到这一点?

2 个解决方案

#1


4  

add display method on your print css or media print css like this:

在您的打印CSS或媒体打印CSS上添加显示方法,如下所示:

@media print {

 #gettingStarted_accordion > *{display:block !important;}

}

#2


2  

FYI I figured out a fix. I simply add media="screen" to the link to the stylesheet for jquery ui. Like so:

仅供我,我找到了解决办法。我只需将media =“screen”添加到jquery ui样式表的链接。像这样:

<link media="screen" rel="stylesheet" type="text/css" href="jquery-ui.css">

And use this in my print.css (thanks to Riskbreaker):

并在我的print.css中使用它(感谢Riskbreaker):

#gettingStarted_accordion > * {
    display: block !important;
}

#1


4  

add display method on your print css or media print css like this:

在您的打印CSS或媒体打印CSS上添加显示方法,如下所示:

@media print {

 #gettingStarted_accordion > *{display:block !important;}

}

#2


2  

FYI I figured out a fix. I simply add media="screen" to the link to the stylesheet for jquery ui. Like so:

仅供我,我找到了解决办法。我只需将media =“screen”添加到jquery ui样式表的链接。像这样:

<link media="screen" rel="stylesheet" type="text/css" href="jquery-ui.css">

And use this in my print.css (thanks to Riskbreaker):

并在我的print.css中使用它(感谢Riskbreaker):

#gettingStarted_accordion > * {
    display: block !important;
}