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

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex