Git Product home page Git Product logo

jquery-peelback's Introduction

jQuery Peelback Ad

This is a jQuery plugin for adding a "peelback" or "peelaway" ad to a page. It's based on this peelback demo, by Soh Tanaka, which achieves the peelback effect by animating the ad image (the background image) and the peel image in parallel.

Some features:

  • Except for the two images, everything is contained in the plugin, which means you can add this to your site without having to touch your stylesheets or HTML.
  • Lightweight. The script and the peel effect image combined are only 7.3KB.
  • Plugs into Google Analytics Event Tracking to record the mouseover/peelback event.
  • Works in all modern browsers as well as IE6, IE7, and IE8.

How to use it:

Just call the .peelback() method on the body element and fill in the parameters.

###Required adImage : path to the ad image (string)
peelImage : path to "peel-image.png" (string)
clickURL : click-through URL for the ad (string)

###Optional smallSize : Specify size of small peel preview (number; default=58)
bigSize : Specify size of full size ad image (number; default=510)
gaTrack : Send peelback events to Google Analytics? (boolean; default=false)
gaLabel : GA event label to use (string; default="default")
autoAnimate : animate peelback corner on pageload (boolean; default=true)
debug : display errors in console (boolean; default=false)

$(function(){
  $('body').peelback({
    adImage     : 'peel-ad.png',
    peelImage   : '../assets/peel-image.png',
    clickURL    : 'http://www.thebestdinosaur.com/',
    smallSize   : 50,
    bigSize     : 500,
    gaTrack     : true,
    gaLabel     : '#1 Stegosaurus',
    autoAnimate : true,
    debug       : false 
  });
});

Demo

http://www.ravelrumba.com/code/demos/jquery-peelback/demo/

Dependencies

jQuery. Tested on 1.4.4 and 1.5.2.

Changelog

0.2: 04/25/2011 - Added image sizes as settings. Removed dataURI version to keep things simple.
0.1: 12/26/2010 - Release

Credits

http://www.sohtanaka.com/web-design/simple-page-peel-effect-with-jquery-css/

jquery-peelback's People

Contributors

robflaherty avatar

Watchers

 avatar

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.