Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (28 sloc) 798 Bytes

css

预加载css

Installation

可以用ES6 模块的形式引入

import {cssLoad} from 'preload';

也可以直接使用CommonJS方式引入

var cssLoad= require('cssLoad');

或者直接引入到HTML里面也可以

<script src="https://unpkg.com/apreload@2.2.4/dist/iife/cssLoad.js"></script>

usage

最简形式使用

	<h1 class="index" id="index">index.css样式表插入</h1>
    <h1 class="main" id="main">main.css样式表插入</h1>
	cssLoad('./style/index.css', document.getElementById("index"), "all");
    cssLoad('./style/main.css', document.getElementById("main"), "all");

change log

2.1.2
2.0.1

You can’t perform that action at this time.