Giter Site home page Giter Site logo

jquery-csshooks's Introduction

cssHooks

A collection of cssHooks that work with jQuery 1.4.3+.

Current Hooks:

  • margin and padding
  • backgroundPosition, backgroundPositionX, backgroundPositionY
  • borderRadius, borderRadiusTopLeft, borderRadiusTopRight, borderRadiusBottomRight, borderRadiusBottomLeft
  • boxShadow, boxShadowColor, boxShadowBlur, boxShadowSpread, boxShadowX, boxShadowY
  • borderImage
  • Alternative Border Radius Plugin with support for IE 6, 7, and 8
  • boxReflect
  • boxSizing
  • textShadow, and textShadowColor, textShadowX, textShadowY, and textShadowBlur
  • color animations for backgroundColor, borderBottomColor, borderLeftColor, borderRightColor, borderTopColor, borderColor, boxShadowColor, color, outlineColor, and textShadowColor
  • columnCount, columnSpan, columnGap, columnWidth, columnRuleColor, columnRuleStyle, columnRuleWidth
  • 2D transforms
  • linear and radial gradients

Usage

Super simple. Just request the margin, padding, backgroundPosition, boxShadow, etc like you would other CSS properties.

// #myElement { margin: 1px 2px 3px 4px; }
$('#myElement').css('margin'); // "1px 2px 3px 4px"

What about setting properties?

// #myElement { box-shadow: #000 1px 1px 3px; }
$('#myElement').css('boxShadow', '#ccc 5px 5px');
$('#myElement').css('boxShadowColor', '#ff5e99');
$('#myElement').css('boxShadowBlur', '0px');
$('#myElement').css('borderImage', 'url(image.jpg) 27 27 27 27 round round');

And even animating?!

$('#myElement').animate({ backgroundPositionY: 100 }, 500);

What are cssHooks?

jQuery 1.4.3 introduced the concept of cssHooks. They allow you to hook directly into jQuery and override how certain css properties are retrieved or set. This allows for browser normalization or even the creation of your own unique css properties.

License

The cssHooks plugin is licensed under the MIT License (LICENSE.txt).

Copyright (c) 2013 Brandon Aaron, Burin Asavesna, Tom Ellis, Phil Dokas and Louis-Rémi Babé.

jquery-csshooks's People

Contributors

atotic avatar brandonaaron avatar burin avatar pdokas avatar tomgrohl avatar

Watchers

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