Code Monkey home page Code Monkey logo

android-toast's Introduction

Hi there ๐Ÿ‘‹

I'm an independent JavaScript and Web Performance consultant. Check out my website jadjoubran.io

I'm currently focusing most of my efforts on teaching the next generation of ambitious developers via my interactive online courses:

I also have some interesting side projects:

I enjoy various sports/activities such as:

  • Snowboarding ๐Ÿ‚
  • Outdoor climbing, sports climbing, and bouldering ๐Ÿง—
  • Road cycling ๐Ÿšด
  • Playing Piano ๐ŸŽน

And I have a lovely ginger cat called Gijsje ๐Ÿˆ

android-toast's People

Contributors

jadjoubran avatar patsy-issa avatar scullwm avatar ushalnaidoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-toast's Issues

this.show is not a function

Hi, just wanted to add simple toast message to my mobile web app but this happens

screen shot 2016-08-28 at 11 53 39 am

just added css and js files and call :

var toast1 = Android_Toast({content: 'Localizado por GPS.'});

thanks

Toast div blocks clicking underneath

The toast_container div blocks clicks.

I have a submit button, on submit it creates a new toast. The placement of the div just happened to be above the submit button when it's invisible.

I found out that the toast div should be removed once the animation finishes, but this does not work in IE.
Add HTML5 event:
toast_container.addEventListener('animationend', function () {
toast_container.parentNode.removeChild(toast_container);
});

Use object as parameter

About the Toast code, I would recommend the use of literal object as parameters, easy to implement and much easer to code with.

in the Class you would find something like that :

function Android_Toast(){

this.timeout_id = null;
this.duration = 3000;
this.content = '';
this.position = 'bottom';
for (var n in arguments[0]) {
this[n] = arguments[0][n];
console.log(arguments[0][n]); // please remove me ;)
}

}

the call would look like that :

var toast = new Android_Toast({content: 'Hello Fries', duration: 5000});

This code is ready to use with the current version, but could be easily done with prototyping :)

Mouse events interference

Hi!
I found your Android toast very nice and started to use it. I experienced that it seemed to interfere with mouse event listeners I am using. After some search and trial, it seems like adding this line to your CSS resolves the probelm:

pointer-events:none;

E.g.

#android_toast_container{
  width:100%;
  position:fixed;
  bottom:12%;
  left:0;
  pointer-events:none;
}

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.