andyhite / jquery-image-twister Goto Github PK
View Code? Open in Web Editor NEWA small jQuery plugin that "twists" images on hover.
Home Page: http://andrew-hite.com/plugins/jQuery-Image-Twister/demo/
A small jQuery plugin that "twists" images on hover.
Home Page: http://andrew-hite.com/plugins/jQuery-Image-Twister/demo/
jQuery Twister ============== NOTE: THIS PLUGIN ONLY WORKS IN BROWSERS THAT DON'T SUCK. That means you'll have to do something else for IE. It's not my fault. I swear. Apparently Firefox (Windows) doesn't play nice either, but I'm working on that. Summary jQuery Twister is a simple plugin that adds a "twist" effect to images when you hover over them. It is dependent on zachstronaut's jquery-animate-css-rotate-scale for animating element rotation in modern browsers, and I take no credit for his work (which does most of the heavy lifting). Usage ===== Unpack the JS files from the root and lib/ directories into your document root and include the following lines before the </head> tag at the top of your document (change the src paths if you put them in another directory): <script src="jquery.js" type="text/javascript"></script> <script src="jquery.transform.js" type="text/javascript"></script> <script src="jquery.rotate.js" type="text/javascript"></script> <script src="jquery.twister.js" type="text/javascript"></script> Make sure the images you want to "twist" have container DIVs. Something like this: <div class="image"> <a href="#"><img src="images/thumb.jpg" /></a> </div> Initialize twister with the following: <script>$(function(){ $('.image').twister(); });</script> Options ======= duration (String, Number): a string representing one of the predefined speeds ("slow" or "fast") or the number of milliseconds to run the animation (default: 250). degrees (Number): a number representing degrees the image will rotate (default: 5) scale (Number): a number representing how much to scale the image (default: 1.2) overflown (Boolean): if set to true, the image will not be masked by it's containing frame. (default: false) Limitations and Dependencies ============================ This plugin is dependent on zachstronaut's jquery-animate-css-rotate-scale (http://github.com/zachstronaut/jquery-animate-css-rotate-scale/) and is therefore limited to jquery-animate-css-rotate-scale's abilities. It does not, unfortunately, play nicely with Internet Explorer at this time. I am actively looking for a replacement that uses canvas for image rotation, but until I find or write one, there is no way around this limitation (IE just doesn't have a good CSS based rotate method). There are also (apparently) issues in Firefox for Windows that I will fix soon. I know for a fact that it works in Safari (Win / Mac), Firefox (Mac), Chrome (Mac). Still need to do some Windows testing. I also haven't tested in Opera yet. If it doesn't work in Opera, give me a heads-up.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.