WordPress.org

Ready to get started?Download WordPress

Forums

Simple Facebook Connect
[resolved] Trying to hide "comment-users-details" if the "fb-user" exists (2 posts)

  1. gian-ava
    Member
    Posted 1 year ago #

    Hi,

    I'm using jQuery to slide down the "#comment-users-details" block when you click into the textarea element, and it works fine.

    But because of the JS code, now when a user is logged in using Facebook and click into the texarea, the "#comment-users-details" will show up.

    So I am trying to use jQuery to check if the "span#fb-user" (the FB logged in block used by the plugin) doesn't exist, and execute the slide down code only in that event, not if it's there. But I got no result.

    The working code for the effect is this:

    $('#comments textarea').click(function(){
    $('#comment-user-details').slideDown("slow");
    });

    And the one I am trying to use to check if a user is logged in with FB is this:

    if ($('span#fb-user').length = 0) {
    $('#comments textarea').click(function(){
    $('#comment-user-details').slideDown("slow");
    });
    }

    Any suggestions?

    Thanks.

    http://wordpress.org/extend/plugins/simple-facebook-connect/

  2. gian-ava
    Member
    Posted 1 year ago #

    Ok, I did get it, with the help of someone on the StackExchange forum, so here's the code:

    $('#comments textarea').click(function() {
    		if ($("#fb-user").length == 0) { // If the "SFC Plugin" element doesn't exists, than apply the code
    			$('#comment-user-details').slideDown("slow");
    		}
    	});

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic