Skip to content
프로젝트

소개

A simple jQuery/Zepto notification library designed to be used in mobile apps

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

OhSnap!.js

Oh Snap ! The server crashed... Try again later :D

A simple jQuery/Zepto notification library designed to be used in mobile apps

Check out this demo page

Installation

Dependency: jQuery or Zepto.

Download ohSnap.js:

  • from Github
  • with Bower: bower install oh-snap.

Add a div.ohsnap which will contain the alerts :

<div id="ohsnap"></div>

Usage

To call a notification, use ohSnap(text, options). Examples :

ohSnap('Succefully created your account');
ohSnap('Oh Snap! I cannot process your card...', {color: 'red', icon: 'icon-alert'}); // color matches CSS class `.alert.color`
ohSnap('Yeeaahh! You are now registered.', {time: '2000'} // time is ms

To remove a notification, use ohSnapX().

Alerts are automatically bound to a click event (internally, ohSnapX() is called when the alert is clicked).

Styling

Furthermore, ohSnap.js creates a div with classes .alert .alert-color so you will want to have something like :

/* ALERTS */
/* inspired by Twitter Bootstrap */

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #eed3d7;
  border-radius: 4px;
  position: absolute;
  bottom: 0px;
  right: 21px;
  /* Each alert has its own width */
  float: right;
  clear: right;
}

.alert-red {
  color: white;
  background-color: #DA4453;
}
.alert-green {
  color: white;
  background-color: #37BC9B;
}
.alert-blue {
  color: white;
  background-color: #4A89DC;
}
.alert-yellow {
  color: white;
  background-color: #F6BB42;
}
.alert-orange {
  color:white;
  background-color: #E9573F;
}

By Justin Domingue

관련 프로젝트 살펴보기

불러오는 중…