html骨架效果,html5 页面基本骨架

本文探讨了JavaScript在现代网页开发中的核心作用,详细介绍了如何利用艺术模板库(artTemplate)和自定义JS类库与头部引用的li-1.2.0.css结合,实现通用模板页面的渲染和组件化。同时,文章还讲解了FastClick库消除移动端300ms延迟的方法,并通过dn.init()函数调用,展示了实际项目中注册主要模块的初始化流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

通用模板页面

var script = document.createElement("script"),

head = document.head || document.getElementsByTagName('head')[0];

script.type = "text/javascript";

script.src = '/config.js?ver=' + (new Date()).getTime();

head.appendChild(script);

script.onload = script.onreadystatechange = function(){

require(

[

'jquery',

'fastclick',

'artTemplate',

'li',//自己封装的js类库,包括head里面引用的li-1.2.0.css

'common',//公共js,存放一些公用的方法

],

function($,FastClick,template){

FastClick.attach(document.body);

var $body = $('body'),

$header = $('header'),

$article = $('article');

var registMain = {

h5: function(){

this.renderHtml();

this.renderComponent();

this.watch();

},

//全局属性

options: {

},

//渲染模板的数据

data: {

},

//渲染html

renderHtml: function(){

},

//渲染组件

renderComponent: function(){

},

//事件监听

watch: function(){

var self = this;

}

}

dn.init(function(){

registMain.h5();

})

})

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值