Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3847958
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:37:49+00:00 2026-05-19T16:37:49+00:00

I have this problem that i’m sure is simple but I can’t seem to

  • 0

I have this problem that i’m sure is simple but I can’t seem to figure it out. I have a javascript function to toggle a div through pressing a button:

javascript:

<script type="text/javascript" charset="utf-8">
//jquery functionality for toggling member interaction containers
function toggleInteractContainers(x)
{
    if($('#'+x).is(":hidden"))
    {
        $('#'+x).slideDown(200);
    }else
    {
        $('#'+x).hide();
    }
    $('.interactContainers').hide();
}
//function for adding friends...receives two arguments
function addAsPal(a,b)
{
    //alert("Member with ID:" +a+ "is requesting to be pals with member with ID:" +b);
    var url = "request_as_pal.php";
    var thisRandNum = "<?php echo $thisRandNum; ?>";
    $("#add_pal").text("please wait...").show();
    $.post(url,{request:"requestPal", mem1:a, mem2:b, thisWipit: thisRandNum}, function(data){
    $("#add_pal").html(data).show().fadeOut(12000);
    });
}
</script>

My html code is (only part of it as it would be too long):

<tr>
    <td height="40" class="ordinary_text_12_blue" align="center">Username:</td>
    <td class="ordinary_text_12"><?php echo $row_user_info ['username'];?></td>
    <td align="right" style="border:none;">
        <a href="#" onclick="return false"
           onmousedown="javascript:toggleInteractContainers('add_friend');">
         Add as Pal
        </a>
    </td>
</tr>
</table>
<div class="interactContainers" id="add_friend">                     
    <div align="right">
        <a class="ordinary_text_12" href="#" onclick="return false"
           onmousedown="javascript:toggleInteractContainers('add_pal');">
         Cancel&nbsp;
        </a>
    </div>
    <div>
        &nbsp; Add &nbsp;<?php echo "$firstname $lastname"; ?>&nbsp; as a Pal? &nbsp;
        <a class="ordinary_text_12" href="#" onclick="return false"
           onmousedown="javascript:addAsPal(<?php echo $user_id;?>,<?php echo $user_id2;?>);">
          Yes
        </a>
    </div>                          
</div> 

If you notice on the 5th line of the above html code, i have

onmousedown="javascript:toggleInteractContainers('add_friend');

This works; change it to this:

onmousedown="javascript:toggleInteractContainers('add_pal');

It does not work.
Can someone help me figure this out. Thanks.

The css code is(if needed):

.interactContainers
{
    margin-left:10px;
    position:relative;
    width:486px;    
    display:none;
    color: #09F;
    font-weight: bold;
    text-decoration: none;
    vertical-align:middle;
    font-size: 12px;    
    background-color:#222;
    border:#FFF 1px solid;  
}

.interactionLinksDiv a
{
    background-color:#222;
    display:inline;
    border:#FFF 1px solid;
    padding:7px;
    color:#9F3;
    font-size:12px;
    text-decoration:none;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T16:37:50+00:00Added an answer on May 19, 2026 at 4:37 pm

    Please take a look at this jsfiddle

    i removed the onmousedown and place it into the onclick event. also removed the

    $('.interactContainers').hide();

    let me know if this is what you were looking for. also from your code we do not see a div with id=’add_pal’ and therefore there’s no add_pal div to hide or show.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this little problem, that I cannot figure out which arguments to pass
I'm sure this is a simple issue, but I have noticed that when I
I have this quite popular problem, but have failed to find a solution that
(I have a problem that I illustrated in this question but had no correct
I have this problem that I probably understand but don't know how to handle,
I have this problem that I cannot fix. From my @Controller , i can
file = [file1,file2,...].join( ) `paste #{file}` Hello, I have this simple problem that has
i have this problem that i can't solve for days now...here is my code.
So, I have this problem that when I word_wrap the text field. But when
I have this simple problem that gets an input from the user using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.