https://github.com/vitkarpov/abfix
emulation :after and :before for IE
https://github.com/vitkarpov/abfix
Last synced: about 2 months ago
JSON representation
emulation :after and :before for IE
- Host: GitHub
- URL: https://github.com/vitkarpov/abfix
- Owner: vitkarpov
- Created: 2012-12-09T15:37:54.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-11T17:35:30.000Z (about 12 years ago)
- Last Synced: 2025-01-17T23:19:46.579Z (3 months ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jquery.abFix
============This tiny plugin emulates :after and :before for IE.
About
-----
I am sure that every developer from one project to another makes the same hack - emulation :before and :after for IE. Generated content is very convenient and, personally, I don't wanna put empty DOM-elements manually in markup.Probably, it is the smallest plugin in the world and very helpful.
How to use
----------
You just need to write your CSS selectors in such way:
.pic:before,
.pic > .ie-prepend {}In your markup you need to add classes .ie-before or .ie-after for elements you'll use :before or :after for.
Initialize plugin only for lte IE7 like this:
$('.ie7').abFix();
How it works
------------
- Plugin finds all elements with .after-fix and .before-fix classes inside elements you've picked with jQuery and applies abFix method. Usually it's one element — body, i.e. all document.- Then it puts before or after inside each found element's content i.ico-append or i.ico-prepend accordingly.
- That's it.
You can redifine classes' names passes your options.
Default options:
{
beforeSelector : 'before-fix',
afterSelector : 'after-fix',
beforeClass : 'ie-prepend',
afterClass : 'ie-append'
}