下面这样不行
<DL id=AccordionMulti class=AccordionMulti><DL>
<DT class=stretchtoggle><B>first section</B>
<DD style="FILTER: ; PADDING-BOTTOM: 0px; MARGIN-TOP: 0px; DISPLAY: none; MARGIN-BOTTOM: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VISIBILITY: visible; OVERFLOW: visible; PADDING-TOP: 0px; opacity: 1; totalHeight: 18; computedTop: 0; computedBottom: 0" class=stretcher>I'm the content for the first section. </DD>
<DT class=stretchtoggle><B>second section</B> </DT>
<DD style="POSITION: static; FILTER: ; PADDING-BOTTOM: 0px; MARGIN-TOP: 0px; ZOOM: 1; DISPLAY: none; MARGIN-BOTTOM: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VISIBILITY: visible; OVERFLOW: visible; PADDING-TOP: 0px; opacity: 1; totalHeight: 18; computedTop: 0; computedBottom: 0" class=stretcher>I'm the content for the second section. </DD>
<DT class=stretchtoggle><B>third section</B> </DT>
<DD style="POSITION: static; FILTER: ; PADDING-BOTTOM: 0px; MARGIN-TOP: 0px; ZOOM: 1; DISPLAY: none; MARGIN-BOTTOM: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VISIBILITY: visible; OVERFLOW: visible; PADDING-TOP: 0px; opacity: 1; totalHeight: 18; computedTop: 0; computedBottom: 0" class=stretcher>I'm the content for the third section. </DD></DL></DL>
<script defer=defer>
var a=document.createElement('style');
var b=document.createTextNode('@import url("http://www.clientcide.com/css/clientside.css")')
a.appendChild(b);
document.body.appendChild(a);</script> 下面是一般加载 不是动态的 可以成功
<style>
@import url("http://www.clientcide.com/css/clientside.css");</style>
<DL id=AccordionMulti class=AccordionMulti><DL>
<DT class=stretchtoggle><B>first section</B>
<DD style="FILTER: ; PADDING-BOTTOM: 0px; MARGIN-TOP: 0px; DISPLAY: none; MARGIN-BOTTOM: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VISIBILITY: visible; OVERFLOW: visible; PADDING-TOP: 0px; opacity: 1; totalHeight: 18; computedTop: 0; computedBottom: 0" class=stretcher>I'm the content for the first section. </DD>
<DT class=stretchtoggle><B>second section</B> </DT>
<DD style="POSITION: static; FILTER: ; PADDING-BOTTOM: 0px; MARGIN-TOP: 0px; ZOOM: 1; DISPLAY: none; MARGIN-BOTTOM: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VISIBILITY: visible; OVERFLOW: visible; PADDING-TOP: 0px; opacity: 1; totalHeight: 18; computedTop: 0; computedBottom: 0" class=stretcher>I'm the content for the second section. </DD>
<DT class=stretchtoggle><B>third section</B> </DT>
<DD style="POSITION: static; FILTER: ; PADDING-BOTTOM: 0px; MARGIN-TOP: 0px; ZOOM: 1; DISPLAY: none; MARGIN-BOTTOM: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; VISIBILITY: visible; OVERFLOW: visible; PADDING-TOP: 0px; opacity: 1; totalHeight: 18; computedTop: 0; computedBottom: 0" class=stretcher>I'm the content for the third section. </DD></DL></DL>
<script defer=defer>
var a=document.createElement('style');
var b=document.createTextNode('@import url("http://www.clientcide.com/css/clientside.css")')
a.appendChild(b);
document.body.appendChild(a);</script> 下面是一般加载 不是动态的 可以成功
<style>
@import url("http://www.clientcide.com/css/clientside.css");</style>
解决方案 »
- ajax请求导致局部变量和全局变量结果不统一
- 循环触发onpropertychange在IE8下的bug问题
- 如何实现循环动态添加。
- iframt access parent dom
- javascript的menu的onMouseOut事件问题?
- 前两天散了200分,今天再散200分,(原因是今天把所有帖子都结帖了。)
- 跪求:如何修改--<script language='JavaScript' type='text/JavaScript' src='/game/article_js.asp?ClassID=22'></script>
- 这个功能如何实现?请高手帮忙!
- 怎样使子窗口未关闭前不能操作父窗口
- 一个jquery easyui后台返回值问题?
- text框中只允许录入英文数字,不允许录入全角中文,也不允许粘贴
- window.open() 全屏问题。
var style = document.createElement('link');
style.href = 'http://www.clientcide.com/css/clientside.css';
style.rel = 'stylesheet';
style.type = 'text/css';
head.appendChild(style);
但是能不能动态加载<style> 标签呢??
谁成功加载过吗?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
</head> <body>
<script type="text/javascript">
<!--
var oHead = document.getElementsByTagName("head")[0];
var oStyle = document.createElement("style");
oStyle.type="text/css";
oHead.appendChild(oStyle); var oCss = document.styleSheets[0];
oCss.cssRules ? (oCss.insertRule("div{width:200px;height:300px;border:2px solid red;}",oCss.cssRules.length )) : oCss.addRule("div", "width:200px;height:300px;border:2px solid red;");
//-->
</script>
<div></div>
</body>
</html>
<link href="http://www.clientcide.com/css/clientside.css" rel="stylesheet" type="text/css"/>但是 我把http://www.clientcide.com/css/clientside.css里面的内容全部复制下来
放到<style>标签中 却不能正确显示 我是在ie8下测试的 为什么会这样????@5楼
只能用insertRule 或addRule加入css字符串而不能加入 css文件吗???
oCss.cssRules ? (oCss.insertRule("@import url('http://www.clientcide.com/css/clientside.css');",oCss.cssRules.length )) : oCss.addRule("", "@import url('http://www.clientcide.com/css/clientside.css');");
觉得有必要用@import url吗?
了解@import吗?
所以只好试试这样 看行不行 感觉也不行