Quantcast

Jump to content


Photo

Scriptcaulous Effe.ctShake


  • Please log in to reply
3 replies to this topic

#1 Noitidart

Noitidart
  • Neocodex Co-Founder

  • 23214 posts


Users Awards

Posted 16 July 2010 - 11:39 AM

Effect.Shake doesn't support afterFinish. It's a bug. Here's my fix to it:

Effect.Shake = function (element) {
    element = $(element);
    var options = Object.extend({distance: 20, duration: 0.5}, arguments[1] || {});
    var distance = parseFloat(options.distance);
    var split = parseFloat(options.duration) / 10;
    var oldStyle = {top: element.getStyle("top"), left: element.getStyle("left")};
    return new (Effect.Move)(element, {x: distance, y: 0, duration: split, afterFinishInternal: function (effect) {new (Effect.Move)(effect.element, {x: - distance * 2, y: 0, duration: split * 2, afterFinishInternal: function (effect) {new (Effect.Move)(effect.element, {x: distance * 2, y: 0, duration: split * 2, afterFinishInternal: function (effect) {new (Effect.Move)(effect.element, {x: - distance * 2, y: 0, duration: split * 2, afterFinishInternal: function (effect) {new (Effect.Move)(effect.element, {x: distance * 2, y: 0, duration: split * 2, afterFinishInternal: function (effect) {new (Effect.Move)(effect.element, {x: - distance, y: 0, duration: split, afterFinishInternal: function (effect) {effect.element.undoPositioned().setStyle(oldStyle);if(typeof(options.afterFinish)=='function'){options.afterFinish()}}});}});}});}});}});}});
}


#2 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 16 July 2010 - 11:42 AM

So many closing brackets...lol

#3 Noitidart

Noitidart
  • Neocodex Co-Founder

  • 23214 posts


Users Awards

Posted 16 July 2010 - 02:59 PM

Haha yeah it gets a little crazy to track all that.

#4 sLAUGHTER

sLAUGHTER
  • Dinnerbone'd

  • 490 posts


Users Awards

Posted 19 July 2010 - 11:30 AM

The brackets look like the non-vb version of part of a source of mine. Just like, 10ish lines of "End If" :I


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users