1.知识点1.document.documentElement//方法获取html(document.documentElement)//document.documentElement是一个document.documentElement,具体获取html标签。setAttribute('data-skin',key)渲染:当key='white'2.:root选择器定义及用法::root选择器匹配文档根元素。在HTML中,根元素始终是html元素。3、通过setItem键值方法存储localStorage,值存储为String类型数据。例如:localStorage.setItem("key","value");当然也可以存储对象,需要用到JSON.stringify(obj);通过getItem("key")转换获取,如果存储对象,使用JSON.parse("")转换成你想要的对象。/***@name:存放localStorage*@param{type}name为属性名;content是属性值*@return:*/setStore(name,content){if(!name)returnif(typeofcontent!=='string'){content=JSON.stringify(content)}window.localStorage.setItem(名称,内容)}2。使用1.分析功能点a.点击按钮切换一组css(这个功能很简单)b.将皮肤设置保存到一个全局变量中,访问其他页面时也能生效c.将设置保存到本地,退出应用再次进入时,仍会加载上次设置的皮肤
