[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

jQuery hide() not working

Posted on 2011-09-06
4
Medium Priority
?
280 Views
Last Modified: 2012-06-27
I have a window which pops up using tb_show("New Window", url, null);

When a button is clicked, I call a function defined in parent window and then get rid of the pop-up.
The parent window function in turn pops up same dialog.  The problem is for the user, it looks like the dialog stays in place, perhaps with a wired blink.  I want the dialog to actually reappear.

Here is the code currently in place:

In parent window:

openPopup();

Also tried:

setTimeout(openPrevAddrPopup(), 5000); - no effect

In Pop-up window:

function openPrevAddrPopup() {
        var url = "#TB_inline?height=300&width=600&inlineId=MyDivID";  
        tb_show("Previous Address", url, null);      
    }  

Function for button click:

function rerunRequest() {
    //debugger
        $(this).hide();
        parent.focus();
        ShowBlockUI('Searching Database');
        SearchInsuredCreditScore(prevAddress);
        HideBlockUI();
        //window.tb_remove(); -- using tb_remove() does not allow re-open same dialog
        parent.$(this).remove();
    }

ShowBlockUI and HideBlockUI are just customizations for jquery BlockUI plugin used throughout the application.

Thank you.
0
Comment
Question by:Mare22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 36489887
please give a link to see your page
0
 

Author Comment

by:Mare22
ID: 36490379
leakim971,

Thank you for response.  I can't legally share a link here.  Is there anything you could suggest to try?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 1000 total points
ID: 36490790
this look strange for me (in bold) :

function rerunRequest() {
    //debugger
        $(this).hide();

I'm not sure you're able to use $(this) in this context.
Remove class to any previous visible object, for example we use the class "poppa"

$(".poppa").removeClass("poppa");

Open in new window


now when you show a popup you add the poppa class to the object just before displaying it :

$(this).addClass("poppa");

Open in new window


and you should be able to use the class anywhere to hide the right object :

function rerunRequest() {
    //debugger
        $(".poppa").hide();
// we don't forget to remove the class
        $(".poppa").removeClass("poppa");

Open in new window


0
 
LVL 82

Assisted Solution

by:hielo
hielo earned 1000 total points
ID: 36490825

Also tried:
setTimeout(openPrevAddrPopup(), 5000); - no effect
If that is what you actually tried, then it will never work because the first argument needs to be a function REFERENCE, not a function call. So, get rid of the parentheses after penPrevAddrPopup:

setTimeout( openPrevAddrPopup, 5000); - no effect

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question