前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >javascript当中link 的alternate stylesheet 用法

javascript当中link 的alternate stylesheet 用法

作者头像
马克java社区
修改2020-01-06 18:20:24
5780
修改2020-01-06 18:20:24
举报
文章被收录于专栏:java大数据java大数据

例 6.4:linkChangeCssFileIEFF.html 切换css文件:document.getElementsByTagName("link"); <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <TITLE> New Document </TITLE> <!-- 马克-to-win: here the idea is that for the whole page, sometimes, we use this css, sometimes, we use that css, with this method, we can switch. with this method, we can switch skin. "alternate stylesheet"是备用样式。 --> <link rel="alternate stylesheet" href="a.css" type="text/css" title="red" /> <link rel="stylesheet" href="b.css" type="text/css" title="green" /> <link rel="alternate stylesheet" href="c.css" type="text/css" title="blue" /> <script language="javascript"> function setActiveStyleSheet(t) { var links = document.getElementsByTagName("link"); links[0].disabled=false; links[1].disabled=true; links[2].disabled=true; alert(links[0].disabled+""+links[1].disabled+links[1].getAttribute("title")+links[2].getAttribute("href")); } </script> </HEAD> <body> 更多请见:https://blog.csdn.net/qq_43650923/article/details/102650892

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档