github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

codler is using GitHub to share code with you!

GitHub is more than just a place to share code. It's a place to keep tabs on your favorite developers and projects, easily contribute fixes and new features, and visualize what's going on inside your codebase!

Sign Up Now

Free for open source

codler / jQuery-Css3-Finalize

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
    • 62
    • 2
  • Source
  • Commits
  • Network
  • Pull Requests (0)
  • Issues (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Switch Branches (1)
    • master ✓
  • Switch Tags (0)
  • Branch List
Sending Request…
Downloads

Tired of adding prefix for each broswer when it comes to the new css3 attributes? — Read more

  Cancel

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

compatible with ie now and apply shim, display:inline-block in ie7 reads as display:inline 
codler (author)
Wed Nov 24 23:57:35 -0800 2010
commit  c74bc76ed45d00078eb5
tree    0c45df9143c0ad91cbed
parent  e8607f5e76fa2c6efb4d
jQuery-Css3-Finalize /
name age
history
message
file README.markdown Wed Nov 24 23:57:35 -0800 2010 compatible with ie now and apply shim, display:... [codler]
directory build/ Fri Oct 29 04:16:45 -0700 2010 faster workcycle, some readme notes [codler]
file jquery.css3finalize.js Wed Nov 24 23:57:35 -0800 2010 compatible with ie now and apply shim, display:... [codler]
directory static/ Wed Nov 24 23:57:35 -0800 2010 compatible with ie now and apply shim, display:... [codler]
directory test/ Wed Nov 24 23:57:35 -0800 2010 compatible with ie now and apply shim, display:... [codler]
README.markdown

CSS 3 Finalize

Some css3 attributes needs to have a prefix in front in order to work in different browser. The plugin takes care of that so you only need to write without the prefix.

For example the css3 attribute box-sizing need to have the prefix

  • -moz- in Firefox
  • -ms- in Internet explorer
  • -webkit- in Chrome, Safari
  • -o- in Opera

If you write without the prefix it won't work in those browser, you need the write each of them. Here is where this jquery plugin comes in. You only need to write it without the prefix and the plugin will automatically add the prefix. With this you will save time and the pain of rewriting same attribute many times.

How to use

Simply add this code to your site

<script src="https://github.com/codler/jQuery-Css3-Finalize/raw/master/static/jquery.css3finalize-latest.min.js"></script>

Alternative links

http://bsy.se/jquery.css3finalize-latest.min.js or http://static.zencodez.net/js/jquery.css3finalize-latest.min.js

Once the script is loaded it will search for style-tags and link-tags (within same domain) and parse them.

Manual loading

If you don't want the script to parse on loading and parse when you want you could set

<script> // Disable autoload window.cssFinalize=false; // Start parse jQuery(function() { $.cssFinalize('style, link'); }); </script>

Tests

This script has been tested in IE 7, FF 3.6, Chrome 7, Safari 5, Opera 10.6 on windows

Some notes

  • The script can only read link-tags where it source are from same domain. Except for local files in IE 7.
  • Link-tags cannot be read on Chrome 7 on local files.

$.fn.Css is extended (cssHooks)

You can leave out the prefix when setting a style in Jquery css method.

Example

$('a').css({'border' : '1px solid #000000', 'column-width' : 10});

In normal case you would have needed to add a prefix

$('a').css({'border' : '1px solid #000000', '-moz-column-width' : 10});

Feedback

I appreciate all feedback.

Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • Русский
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Русский
  • Српски
  • Svenska
  • 中文

Keyboard Shortcuts

Site wide shortcuts

s
Focus site search
?
Bring up this help dialog

Commit list

j
Move selected down
k
Move selected up
t
Open tree
p
Open parent
c or o or enter
Open commit

Pull request list

j
Move selected down
k
Move selected up
o or enter
Open issue

Issues

j
Move selected down
k
Move selected up
x
Toggle select target
o or enter
Open issue
I
Mark selected as read
U
Mark selected as unread
e
Close selected
y
Remove selected from view
c
Create issue
l
Create label
i
Back to inbox
u
Back to issues
/
Focus issues search

Network Graph

← or h
Scroll left
→ or l
Scroll right
↑ or k
Scroll up
↓ or j
Scroll down
t
Toggle visibility of head labels
shift ← or shift h
Scroll all the way left
shift → or shift l
Scroll all the way right
shift ↑ or shift k
Scroll all the way up
shift ↓ or shift j
Scroll all the way down