How to use fastclick - 10 common examples

To help you get started, we’ve selected a few fastclick examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fephil / garrus / src / js / app.js View on Github external
/* global $ */

var svg4everybody = require('svg4everybody')
var Holder = require('holderjs') //eslint-disable-line
var FastClick = require('fastclick')
// var sortBy = require('lodash/collection/sortBy')

FastClick.attach(document.body)

svg4everybody()

console.log('testing if jquery is loaded globally:')
console.log($)

require('./test')
github StreetSupport / streetsupport-web / src / js / shared.js View on Github external
// NPM require
var Holder = require('holderjs');
var FastClick = require('fastclick');
FastClick.attach(document.body);

// Local require
var nav = require('./nav.js');
github Someguy123 / understeem / app / components / App.jsx View on Github external
componentDidMount() {
        require('fastclick').attach(document.body);
        // setTimeout(() => this.setState({showCallout: false}), 15000);
    }
github xautlx / s2jh4net / entdiy-app / entdiy-app-hybrid / src / index.js View on Github external
import React from 'react'
import ReactDOM from 'react-dom'
import Root from './containers/root'
import 'animate.css'
import './styles/core.less'
// antd-mobile的依赖项 #576

require('fastclick').attach(document.body)

const startApp = () => {
  ReactDOM.render(, document.getElementById('root'))
}

//为document添加一个数组,存放'on'方法绑定的事件及其执行函数
document.onEventsArray=[];

//document.on方法定义,类似jquery的on, 将事件方法存放至document.onEventsArray中,并用addEventListener绑定事件
document.on=function(event,fn){
	let eventArr=document.onEventsArray;
	const boundEvent=eventArr.filter((child)=>event===child.event);
	if(boundEvent.length){
		boundEvent[0].fns.push(fn)
	}else{
		eventArr.push({
github concord-consortium / lab / src / lab / common / controllers / interactives-controller.js View on Github external
};

    //
    // Initialization.
    //

    // Select interactive container.
    // TODO: controller rather should create it itself to follow pattern of other components.
    $interactiveContainer = $(viewSelector);

    // Attach FastClick only to the interactive container. We don't want to affect rest of the
    // web page (e.g. by attaching FastClick to "body" or window), let its developer decide whether
    // FastClick should be used there or not. It solves two issues on mobile browsers:
    // - eliminates 300ms delay between a physical tap and the firing of a click event
    // - fixes sticky :hover state (https://www.pivotaltracker.com/story/show/58373748)
    FastClick.attach($interactiveContainer[0]);

    // add container to API
    controller.interactiveContainer = $interactiveContainer;
    // Initialize semantic layout.
    semanticLayout = new SemanticLayout($interactiveContainer);
    controller.on("resize.share-dialog", function () {
      shareDialog.updateIframeSize();
    });

    loadInteractive(interactiveReference);
    return controller;
  };
});
github dawsontoth / zwifit / src / api / web-src / src / main.ts View on Github external
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import * as fastClick from 'fastclick';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

fastClick.attach(document.body);

if (environment.production) {
	enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
	.catch(err => console.error(err));
github klembot / twinejs / src / ui / index.js View on Github external
init() {
		if (inited) {
			return;
		}

		inited = true;

		/*
		This API depends on whether we're using the CDN or the CommonJS module
		:(
		*/

		if (fastclick.attach !== undefined) {
			fastclickInstance = fastclick.attach(document.body);
		} else {
			fastclickInstance = fastclick(document.body);
		}
	},
github Lucifier129 / react-lite / lib / react-tap-event-plugin.js View on Github external
module.exports = function injectTapEventPlugin() {
	var supportTouch = ('ontouchstart' in document);
	if (supportTouch) {
		Fastclick.attach(document.body);
	}
};
github kjda / ReactJs-Phonegap / app / src / app.jsx View on Github external
initApp: function(){
		document.addEventListener('backbutton', this.handleBackButton, false);
		document.addEventListener('offline', this.onOffline, false);
		document.addEventListener('online', this.onOnline, false);
		document.addEventListener("resume", this.onResume, false);
		if( this.isAndroid() ){
			this.initAndroid();
		}
		if( this.isIOS() ){
			this.initIOS();
		}
		FastClick.attach(document.body, {});
	},
github lancetw / react-isomorphic-bundle / src / shared / components / AppHandler.js View on Github external
componentDidMount () {
    require('fastclick').attach(document.body)
  }

fastclick

Polyfill to remove click delays on browsers with touch UIs.

MIT
Latest version published 10 years ago

Package Health Score

56 / 100
Full package analysis

Popular fastclick functions