Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left and top distance #31

Closed
sherban1988 opened this issue Mar 6, 2014 · 1 comment
Closed

Left and top distance #31

sherban1988 opened this issue Mar 6, 2014 · 1 comment
Labels

Comments

@sherban1988
Copy link

Hey. Awesome AWESOME plugin. Really cool of you to take the time making it and sharing it with the world like this. Real simple to use too, and the added bonus of being able to use actual words and sentences? Genius!

Just thought you should know of a small issue. If the direction is selected as left or top, the distance isn't taken into account. It moves the same (24 px). I believe that can be seen in your demo as well.

Anyway, that's the only thing I can find wrong with it, so great job on your part.

@jlmakes
Copy link
Owner

jlmakes commented Mar 6, 2014

Hey @sherban1988

Thanks for the kinds words. I’m glad you like it!

Thanks for catching this! (I thought this was fixed, see #13)

Now that you mention it, I see an issue with the code—I believe right here:

  //  After all values are parsed, let’s make sure our our
  //  pixel distance is negative for top and left entrances.
  //
  //  ie. "move 25px from top" starts at 'top: -25px' in CSS.

      if (enter == "top" || enter == "left") {
        if (!typeof parsed.move == "undefined") {
          parsed.move = "-" + parsed.move;
        }
        else {
          parsed.move = "-" + this.options.move;
        }
      }

I believe it’s the first if () block that’s incorrect — haha, not sure why I overcomplicated things; when I try:

      if (enter == "top" || enter == "left") {
        if (parsed.move) {
          parsed.move = "-" + parsed.move;
        }
        else {
          parsed.move = "-" + this.options.move;
        }
      }

It works as intended. I will push this change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants