Skip to main content

mint.com javascript dropdown effect


I need to recreate an effect that mint.com has on another website. When you go to the transactions page and click on one of your transactions a tab pops up underneath that says edit details. When you click on that tab a div will drop down exposing more details about the transaction. I don't even know what this kind of effect this is called but I need to know to recreate something like this preferably with jquery.



There are some screenshots of what I'm talking about below.



closed



open


Source: Tips4allCCNA FINAL EXAM

Comments

  1. only thing you would need to do is get the position of the clicked element and display a div bellow it .. of course you need to have something that gets all the extra information and displays it .. so first thing I would do is create a div somewhere on the page and hide it

    <div id="myEditRecordContainer" style="position:absolute; top: 0px; left: 0px; display: none"></div>


    then I would set the click handler

    $('.recordDiv').click(function(e){
    //get the position of the clicked element
    var position = $(e.target).position();

    //set position of the div bellow the current element
    $('div#myEditRecordContainer').css({"top" : position.top() + $(this).height() + "px", "left": position.left()});

    //some kind of method that will get or populate the extra information
    //you can use the $.ajax() to get the html from a web service or something along those lines
    var detailsHtml = GetExtraRecordDetails();
    $("div#myEditRecordContainer").html(detailsHtml);

    //now display the div - we already set the css for the position
    //correctly so it should just display where you wanted it
    $("div#myEditRecordContainer").show();
    });


    and the only thing you would need to do on the "I'm done" button is call

    $("div#myEditRecordContainer").hide();


    after submitting the changes of course :)

    I didn't have a whole lot of time to give maybe a more detailed example but this was just of the top of my head what I would do in this case ..

    I really hope this at least gives you an idea as to what you can do.

    ReplyDelete
  2. Here is a jQuery plugin that does just that: http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.