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 8904197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:04:00+00:00 2026-06-15T02:04:00+00:00

I need to hide a div and, with this code it works fine: var

  • 0

I need to hide a div and, with this code it works fine:

    var idObj = $(this).attr('key');
var valH = $(this).attr('hideval');
var valS = $(this).attr('showval');

if ($('div[name='+idObj+']').attr('isdisplay') == 'no') {
    $('div[name='+idObj+']').children().show("slow");
    $('div[name='+idObj+']').attr('isdisplay','yes');
    var divTitle = $('div[name='+idObj+']').children().first();
    var divArrow = $(this).children().first();
    //.attr('src',prefixImg+valH);

    //divTitle.show();
    //divArrow.show();
    $(this).children().first().attr('src',prefixImg+valH);
} else {

    var divTitle = $('div[name='+idObj+']').children().first();
    var divArrow = $('div[name='+idObj+']').children().last();
    //.attr('src',prefixImg+valS);

    $('div[name='+idObj+']').children().hide();
    $('div[name='+idObj+']').attr('isdisplay','no');

    divTitle.show();
    divArrow.show();
    $(this).children().first().attr('src',prefixImg+valS);
}

My div is hidden and the Title and arrows to reopen the div are shown. But if I try to use hide(“slow”) the divTitle and divArrow don’t appear when my div is closed. Same problem using hide(1000).

Is there a difference between hide with and without “slow” parameter?

thanks,
Andrea

  • 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-06-15T02:04:01+00:00Added an answer on June 15, 2026 at 2:04 am

    $(element).hide() hides an element instantly, where $(element).hide('slow') will animate its disappearance (slowly).

    It looks like (though I’m not sure) you want to do stuff after the animation is finished. In that case, do something like this:

    var that = this;  // here to preserve scope for the block below
    $('div[name='+idObj+']').children().hide('slow', function() {
    
        // This stuff happens after the hide animation is done.
        $('div[name='+idObj+']').attr('isdisplay','no');
    
        divTitle.show();
        divArrow.show();
        $(that).children().first().attr('src',prefixImg+valS);  // <= note "that" instead of "this"
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code works fine in Firefox and IE. In Chrome, you need to click
I need a bit of help again... I have this code: <div id=lyrics> <div
Hey, can you help me figure this out? I need to hide/show a div
I have some code like this if ($('.lblpricefrom > strong').html() == '£'){ $('.lblpricefrom').parents(div.resultsitem).hide();} But
this is my code for now: jQuery(document).ready(function($) { $(div#main).hide(); $(div#footer).hide(); setTimeout(function () { $(div#main).fadeIn(slow);
I need to hide div 'email' content if the div 'name' is empty. I
I need to hide the present div and show next hide here is my
Possible Duplicate: how to hide a div after some time period? i need to
I have this code for a JQuery a dialog for a div containing a
Hi this is the code that is being generated automatically: <div class=divider></div> <article class=link></article>

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.