是否可以将条件样式表添加到xpage.
在html中这样做:
<!--[if lt IE 8]><link rel="stylesheet" href="../../blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
Run Code Online (Sandbox Code Playgroud)
关于添加计算字段设置为HTML和代码javascript如:
return '<!--[if lt IE 8]><link rel=\"stylesheet\" href=\"../../blueprint/ie.css\" type=\"text/css\" media=\"screen, projection\"><![endif]-->'
Run Code Online (Sandbox Code Playgroud)
但它会被包含在页面的主体中,而不是与其他样式表的标题.
需要使用http://blueprintcss.org进行概念验证.
您可以将带有SSJS 的呈现属性用于仅显示IE的元素:
渲染= "#{的javascript:context.getUserAgent()isIE()}"
然后,如果使用Internet Explorer打开XPage,则CSS ressource将仅添加到生成的HTML响应中.
编辑:
在您的情况下,这应该符合您的要求:
<xp:this.resources>
<xp:styleSheet href="../../blueprint/ie.css"
rendered="#{javascript:context.getUserAgent().isIE(0,7)}"
media="screen, projection">
</xp:styleSheet>
</xp:this.resources>
Run Code Online (Sandbox Code Playgroud)
Xpage主题对此非常有用.Notes安装中包含一个示例.
转到C:\ Notes目录\xsp \nsf\themes
制作webStandard.theme的副本,重命名为webStandard.xml并在您选择的编辑器中打开,这将向您展示主题可以做什么的很多示例.应用属性,添加资源,通过表达式计算这些等.
片段:
<resource rendered="#{javascript:context.isDirectionRTL()}">
<content-type>text/css</content-type>
<href>/.ibmxspres/global/theme/webstandard/xspRTL.css</href>
</resource>
<!-- IE Specific -->
<resource rendered="#{javascript:context.getUserAgent().isIE(0,6)}">
<content-type>text/css</content-type>
<href>/.ibmxspres/global/theme/webstandard/xspIE06.css</href>
</resource>
<resource rendered="#{javascript:context.getUserAgent().isIE(7,8)}">
<content-type>text/css</content-type>
<href>/.ibmxspres/global/theme/webstandard/xspIE78.css</href>
</resource>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2205 次 |
| 最近记录: |