Code Monkey home page Code Monkey logo

byted-vue-mobile-select's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

byted-vue-mobile-select's Issues

需要阻止默认行为,不然会appchild多次

`init: function(e) {
var n = this;
if(e.trigger && (n.trigger = document.querySelector(e.trigger)), n.wheel = t(n.mobileSelect, "wheel"), n.slider = t(n.mobileSelect, "selectContainer"), n.wheels = n.mobileSelect.querySelector(".wheels"), n.liHeight = n.mobileSelect.querySelector("li").offsetHeight, n.ensureBtn = n.mobileSelect.querySelector(".ensure"), n.closeBtn = n.mobileSelect.querySelector(".cancel"), n.grayLayer = n.mobileSelect.querySelector(".grayLayer"), n.popUp = n.mobileSelect.querySelector(".content"), n.callback = e.callback ? e.callback : function() {}, n.transitionEnd = e.transitionEnd ? e.transitionEnd : function() {}, n.initPosition = e.position ? e.position : [], n.titleText = e.title ? e.title : "", n.trigger && (n.trigger.style.cursor = "pointer"), n.setTitle(n.titleText), n.checkCascade(), n.cascade && n.initCascade(), 0 == n.initPosition.length)
for(var r = 0; r < n.slider.length; r++) n.initPosition.push(0);
n.setCurDistance(n.initPosition), n.addListenerAll(), n.closeBtn.addEventListener("click", function() {
n.mobileSelect.classList.remove("mobileSelect-show")
n.mobileSelect.classList.remove("mobileSelect-show")
}), n.ensureBtn.addEventListener("click", function() {
event.stopPropagation()
event.preventDefault()
n.mobileSelect.classList.remove("mobileSelect-show");
for(var t = "", e = 0; e < n.wheel.length; e++) e == n.wheel.length - 1 ? t += n.getValue(e) : t += n.getValue(e) + " ";
n.trigger && (n.trigger.innerHTML = t), n.callback(n.getIndexArr(), n.getJson())
}), n.trigger && n.trigger.addEventListener("click", function() {
n.mobileSelect.classList.add("mobileSelect-show")
event.stopPropagation()
event.preventDefault()

				}),n.trigger.addEventListener("touchmove", function() {
					event.stopPropagation()
					event.preventDefault()

				}),
				n.grayLayer.addEventListener("click", function() {
					event.stopPropagation()
					event.preventDefault()
					n.mobileSelect.classList.remove("mobileSelect-show")
				}), n.popUp.addEventListener("click", function() {
					event.stopPropagation()
					event.preventDefault()
				}), n.fixRowStyle()
			}`

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.