Giter VIP home page Giter VIP logo

css3's Introduction

项目用到一些工具

  • util.js工具函数库

将平时遇到的一些函数积累起来封装的通用函数库,使用原生JS实现,包括类型判断、日期格式化、根据给定日返回倒计时对象、深拷贝、数组去重、跨浏览器addEvent、跨浏览器removeEvent、ajax、dom操作等一系列的api。

  • expose.js 曝光加载插件

依赖于 util.js,调用方式。(在require.js中)

require(['expose'],function(Exposure){
	//传入元素和回调函数
	Exposure.init(element,callback);
})
  • r.js打包压缩

不符合AMD规范的模块在用require()加载之前,要先用require.config()方法,定义它们的一些特征。在requireJsconfig方法中,这些模块可以使用shim定义。

require.config({
  baseUrl:'js/modules',
  shim: {
    'imagesloaded':{
      exports: 'imagesloaded'
    }
  }
});

这个项目使用imagesloaded插件来判断页面所以得图片是否加载完毕。这个模块不符合AMD规范,所有可以使用skim属性来定义。

bulid.js文件配置选项非常多,这个项目里只用到简单三个。

({
  baseUrl:'modules',//规定基准路径
  name:"../main",//打包入口文件
  out:"../main.min.js"//压缩文件的输出路径
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.