Link to home
Start Free TrialLog in
Avatar of cmushaun
cmushaunFlag for United States of America

asked on

Display Div with Javascript

I have a hyperlink in my html that displays a div popup on the same page I'm already on. see hyperlink below.  What I want to do is remove this from being displayed when the link is clicked, but display the div popup instead when a javascript function is called.

my existing URL that works:
<a href="#TB_inline?height=485&width=420&inlineId=blurp_remove" class="thickbox" >About us</a>

Any Ideas?  Thanks!
Avatar of remorina
remorina
Flag of Australia image

Hi cmushaun,

Try
tb_show("", "#TB_inline?height=485&width=420&inlineId=blurp_remove", "");

Avatar of cmushaun

ASKER

Hello,

I tried this, did not launch the popup as is.  Do I need to define tb_show method?

Thanks,
Mike
No it should work since it's the show method that already exists in the script
Are you using ThickBox for jquery?

To validate that it should work, open http://jquery.com/demo/thickbox/ then in the address/URL box of the browser type the following

javascript:tb_show("", "#TB_inline?height=155&width=300&inlineId=hiddenModalContent&modal=true", "");

it should launch the third example on the page for the inline content.

So maybe you're missing something?

Also are you troubleshooting with FireBug and getting any error messages ?

That does launch the popup on the jquery site, and I am using thickbox. I will install firebug now and check for errors.  Thanks! will post back with my results.
I think my problem is coming from calling this function call after a postback. ..Still digging in
I see, postback sometimes causes issues, you should still be able to get this working after a postback, hope you get it working
Can you think of any reason this would display correctly if I use "onclientclick", enter this in the URL, but does not work when it is embedded in a JS function below:

        function getReply(var1) {

            if (var1 > 0) {
                tb_show('', '#TB_inline?height=485&width=690&inlineId=blurp_respond', '');
            }
ASKER CERTIFIED SOLUTION
Avatar of remorina
remorina
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for all your help so far.  I think I know why it is still not working for me.

I am trying to call this popup during a postback, but that is throwing it off somehow. I am trying to come up with a way to call it after the page is loaded again... Thanks for everything so far!
Thanks, Got it with this!