1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question: Show/Hide div after user clicks "like"

Discussion in 'FaceBook' started by MarketerX, Jun 11, 2011.

  1. MarketerX

    MarketerX Regular Member

    Joined:
    Mar 7, 2010
    Messages:
    398
    Likes Received:
    120
    Hello BHW,

    I am wondering how to show/hide divs after a user clicks a "like button" on my page.

    I want div1 to hold my like button, and when it is clicked to be replaced with div2.

    Hope this makes sense, I know jquery is involved...
     
  2. johnsmith21

    johnsmith21 Newbie

    Joined:
    Sep 23, 2009
    Messages:
    18
    Likes Received:
    6
    Something like this.

    $(document).ready(function(){
    $('#likebuttonID').click(function(){
    var div2html = $('#div2ID').html();
    $('#div1ID').html(div2html);
    });

    });
     
  3. MarketerX

    MarketerX Regular Member

    Joined:
    Mar 7, 2010
    Messages:
    398
    Likes Received:
    120
    I want Div1 to be hidden/Div2 to be shown when the Event.Subscribe facebook event is fired...can you help??
     
  4. cyanide77

    cyanide77 Newbie

    Joined:
    May 25, 2009
    Messages:
    31
    Likes Received:
    3
    Home Page:
    Using JS for it is the best method to smoothly transition from div to div.