Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hakim-d/floating-text-ad

An Ad Unit for beautifully displaying Text Ads. Introduce an image url, a title and a little description to go!
https://github.com/hakim-d/floating-text-ad

Last synced: 29 days ago
JSON representation

An Ad Unit for beautifully displaying Text Ads. Introduce an image url, a title and a little description to go!

Awesome Lists containing this project

README

        

Floating Text Ad
================

An Ad Unit for beautifully displaying Text Ads, introduce an image url, a title and a little description to go!

Demo

Usage

``` javascript
// image width, image height, image url
floatingTextAd.setImage(180, 135, "http://hakim.ma/labs/floating-text-ad/thumb.jpg");
// title, description
floatingTextAd.setText("Flying Dodo", "Get as far as you can before you run out of fuel.");
// click url, open target
floatingTextAd.setClickUrl("http://www.doubleduck.co/games/flying-dodo/", "_blank");
// show Ad
floatingTextAd.init();
```

Options


Show the Ad after a time delay (milliseconds) (default: "1000")

``` javascript
// 2 seconds delay
floatingTextAd.init(2000);
```

Description text length

``` javascript
// description length is 15 words
floatingTextAd.setText("Flying Dodo", "Get as far as you can before you run out of fuel.", 15);
```

Ad Unit theme color

``` javascript
floatingTextAd.setColor("#808000");
```

Change the call-to-action button text (default: "Play Now")

``` javascript
// "Watch Now", "Jouez", "Spielen", "إلعب الآن"…
floatingTextAd.setCTA("Watch Now");
```

Label text (default: "HOT!")

``` javascript
// "NEW!", "SALE"…
floatingTextAd.setLabel("NEW!");
```

Frequency capping (hours) (Default: "None")

Set a number of hours this Ad Unit should not appear again when the user hits the Close button.

``` javascript
// The Ad shows once per 12 hours
floatingTextAd.setCapping(12);
```