Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed test.js

  • Loading branch information...
commit 4637d98dcd7e67b15acc9379565af06275894c6a 1 parent db3182c
@pupunzi authored
Showing with 26 additions and 20 deletions.
  1. +3 −10 demo.html
  2. +23 −10 inc/jquery.mb.CSSAnimate.js
View
13 demo.html
@@ -83,7 +83,6 @@
var w = 30 * Math.floor((Math.random() * 15));
var h = 30 * Math.floor((Math.random() * 15));
-
var t = Math.floor(Math.random() * (cH-h));
var l = Math.floor(Math.random() * (cW-w));
var r = Math.floor(Math.random() * 360);
@@ -107,27 +106,22 @@
$.fn.printHTML=function(){
return this.each(function(){
- var content=$(this).html();
+ var $el = $(this);
+ var content=$el.html();
content=content.replace(/</g,"&lt;");
content=content.replace(/>/g,"&gt;");
- $(this).html(content);
+ $el.html(content);
})
};
-
$(function(){
-
if (self.location.href == top.location.href){
var logo=$("<a href='http://pupunzi.com' style='position:absolute;top:10px;left:10px;z-index:1000'><img id='logo' border='0' src='http://pupunzi.com/images/logo.png' alt='mb.ideas.repository'></a>");
$("body").append(logo);
$("#logo").fadeIn();
}
-
$(".elements .test").test();
-
-
-
$("[data-code=true]").printHTML();
});
@@ -204,7 +198,6 @@
$(".test").test();
-
</code>
</pre>
</p>
View
33 inc/jquery.mb.CSSAnimate.js
@@ -1,21 +1,19 @@
/*******************************************************************************
jquery.mb.components
- Copyright (c) 2001-2011. Matteo Bicocchi (Pupunzi); Open lab srl, Firenze - Italy
+ Copyright (c) 2001-2012. Matteo Bicocchi (Pupunzi); Open lab srl, Firenze - Italy
email: mbicocchi@open-lab.com
site: http://pupunzi.com
- blog: http://pupunzi.open-lab.com
Licences: MIT, GPL
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
-
******************************************************************************/
/*
*
* jQuery.mb.components: jquery.mb.CSSAnimate
- * version: 1.0- 04/12/11 - 18
- * © 2001 - 2011 Matteo Bicocchi (pupunzi), Open Lab
+ * version: 1.5
+ * © 2001 - 2012 Matteo Bicocchi (pupunzi), Open Lab
*
* Licences: MIT, GPL
* http://www.opensource.org/licenses/mit-license.php
@@ -38,7 +36,7 @@
*/
-$.fn.CSSAnimate = function(opt, duration, ease, properties, callback) {
+$.fn.CSSAnimate = function(opt, duration, delay, ease, properties, callback) {
return this.each(function() {
var el = $(this);
@@ -46,6 +44,7 @@ $.fn.CSSAnimate = function(opt, duration, ease, properties, callback) {
if (el.length === 0 || !opt) {return;}
if (typeof duration == "function") {callback = duration;}
+ if (typeof delay == "function") {callback = delay;}
if (typeof ease == "function") {callback = ease;}
if (typeof properties == "function") {callback = properties;}
@@ -61,9 +60,9 @@ $.fn.CSSAnimate = function(opt, duration, ease, properties, callback) {
}
if (!duration) {duration = $.fx.speeds["_default"];}
-
if (!ease) {ease = "cubic-bezier(0.65,0.03,0.36,0.72)";}
if (!properties) {properties = "all";}
+ if (!delay) {delay = 0;}
//http://cssglue.com/cubic
// ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier(<number>, <number>, <number>, <number>)
@@ -74,7 +73,7 @@ $.fn.CSSAnimate = function(opt, duration, ease, properties, callback) {
}
var sfx = "";
- var transitionEnd = "TransitionEnd";
+ var transitionEnd = "transitionEnd";
if ($.browser.webkit) {
sfx = "-webkit-";
transitionEnd = "webkitTransitionEnd";
@@ -102,11 +101,12 @@ $.fn.CSSAnimate = function(opt, duration, ease, properties, callback) {
el.css(sfx + "transition-property", properties);
el.css(sfx + "transition-duration", duration + "ms");
+ el.css(sfx + "transition-delay", delay + "ms");
el.css(sfx + "transition-timing-function", ease);
setTimeout(function() {
el.css(opt);
- }, 0);
+ }, 1);
var endTransition = function() {
el.get(0).removeEventListener(transitionEnd, endTransition, false);
@@ -114,10 +114,23 @@ $.fn.CSSAnimate = function(opt, duration, ease, properties, callback) {
if (typeof callback == "function") callback();
};
el.get(0).addEventListener(transitionEnd, endTransition, false);
-
})
};
+$.fn.CSSAnimateStop=function(){
+ var sfx = "";
+ if ($.browser.webkit) {
+ sfx = "-webkit-";
+ } else if ($.browser.mozilla) {
+ sfx = "-moz-";
+ } else if ($.browser.opera) {
+ sfx = "-o-";
+ } else if ($.browser.msie) {
+ sfx = "-ms-";
+ }
+ $(this).css(sfx + "transition", "");
+}
+
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function() {
Please sign in to comment.
Something went wrong with that request. Please try again.