Giter Site home page Giter Site logo

chimpaxify's Introduction

#Chimpaxify [Build Status] (https://travis-ci.org/colindresj/chimpaxify)

Chimpaxify is a tiny (~1kb minified) jQuery plugin that uses Ajax to submit your MailChimp forms.

Download the production version or the development version.

##How to Use Simply include Chimpaxify on your page after jQuery:

<script src="jquery.js"></script>
<script src="chimpaxify.js"></script>

Download any of the forms from MailChimp, or create your own. If you decide to create your own form, make sure to have an input with type set to email. Then, simply call Chimpaxify onto your form using its ID selector:

$(function() {
  $('#foo').chimpaxify();
});

A css stylesheet and loading gif are included. Add the stylesheet like so:

<link rel="stylesheet" href="chimpaxify.css">

Make sure you properly reference the location of the loading gif in your styles.

##Options

Name Type Default Description
url string Your form's action attribute Your MailChimp list URL
timeOut number 3500 How long to wait before timing out
delay number 4000 How long to show the error/success message
speed number or string 'slow' How fast to animate the error/success message
easing string 'swing' The easing used when animating the error/success message
loader boolean true Show the loading gif or not
successMessage string 'Success. A confirmation email has been sent your way.' The message to show after an email is successfully sent to MailChimp

##Events Chimpaxify triggers success and error events that give you added functionality for defining what occurs when a new contact has been added to your Mailchimp list, or a failed attempt has occured.

Because the events are namespaced, you can choose to listen for chimpaxify or the individual events, success.chimpaxify and err.chimpaxify. Inside any event handler, you'll have access to the jQuery event itself, as well as the Mailchimp response.

Since Chimpaxify returns your form element, you can keep this concise by chaining .on to the end of the Chimpaxify method.

$(function() {
  $('#foo').chimpaxify().on('chimpaxify', function(e, response) {
    // your code here
  });
});

Please not that these success and error events are fired depending on the response received from MailChimp. They are not related to the XHR object.

chimpaxify's People

Contributors

colindresj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

chimpaxify's Issues

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.