Code Monkey home page Code Monkey logo

flash_heed's Introduction

FlashHeed: Fix Flash Ads That Go Above Your Content

Tired of flash ads (or other flash content) that ignore z-index and go over your DOM content on the page? Use FlashHeed to fix them.

The issue is that flash elements that don't specify a wmode, or set wmode to window will not preserve stacking order on your webpage. In fact, they will go above any content, no matter what kind of z-index voodoo you try.

This problem is easy to solve if you deliver and own the flash content: just stick <param name="wmode" value="transparent"> in your object tag and set wmode="transparent" in your embed tags and you're good to go. But, what if you cannot alter the flash server-side? This is a common problem with flash ads, like Google AdSense.

For these situation, FlashHeed will dynamically add these paramters, taking into account various browser quirks.

Compatibility

FlashHeed has been tested in Firefox 3, Safari 5, Chrome 7, IE6, IE7, and IE8. In other words, it should work in most major browsers.

Usage

FlashHeed has no dependencies. Just include the script in your webpage (preferably in the <head>):

<script type="text/javascript" src="flash_heed.js"></script>

A FlashHeed object will now be available.

It currently has one method: heed. Call it without any arguments like so:

FlashHeed.heed();

And it will fix up all the flash elements on a page. Or, you can pass in a scope, and it will only fix ads that are children of that DOM node:

FlashHeed.heed(document.getElementById('container'));

Of course, you should probably call this method onDomLoad.

That's it! Never again will your drop down menus and lightboxes be terrorized by flash ads!

flash_heed's People

Contributors

jmfanizza 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.