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

Wrong height #2

Open
defsdoor opened this issue Jul 5, 2011 · 0 comments
Open

Wrong height #2

defsdoor opened this issue Jul 5, 2011 · 0 comments

Comments

@defsdoor
Copy link

defsdoor commented Jul 5, 2011

var flashHeight = $('.flash_message').css("height");

Should be

var flashHeight = $('.flash_message').innerHeight();

I've also changed the bulk of the js to -

  var fm = $('.flash_message');
  if ( fm.length>0 ) {
    // Grab height of Flash Message
    fm.each( function() {
      var flashHeight = $(this).innerHeight();

      // Calculate closed position of flash message
      // Negate height, parse to integer, add CSS shadow height
      var closePos = "-" + (parseInt(flashHeight) + boxShadowOffset) + "px";

      // On Document load, slide down flashes then slide up after delay of 3 seconds
      $(this).animate({ marginTop: 0 }).delay(delayTime).animate({ marginTop: closePos });

      // Dissmiss Flash Messages
      $('#flash_close').click(function(){
        $(this).stop(); //Stop Animation
        $(this).animate({ marginTop: closePos }); // Slide up
      });
    } );
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant