Jump to content

Please help me!!!


Guest smallsand
 Share

Recommended Posts

Guest smallsand

Hi i have a problem and this is my code<div style="position:relative; visibility:visible;" id="obj"> <table><tr><td> Something here </td></tr></table></div>and this my javascript codefunction showDetail(obj){ var style=obj.style; if (style.position=='relative' || style.visibility=='visible'){ style.position='absolute'; style.visibility='hidden'; style.zIndex=-1; }else { style.position='relative'; style.visibility='visible'; style.zIndex=1; }}i want when i click on something (for example an image) the all of the content of the div tag will be hidden, and the next time , it's content will be shown, but it not showi dont know why, i have replaced the table tag by the normal text and it' okPlease tell me something about that problem!!!!Thanks very much

Link to comment
Share on other sites

This should help you get started.

<head><script>function showDetail(){var style=document.getElementById('obj').style.visibility;  if (style=='visible')  {    document.getElementById('obj').style.visibility='hidden';  }else document.getElementById('obj').style.visibility='visible';}</script></head><body><input type="button" value="click me" onclick="showDetail()"><div style="position:relative; visibility:visible;" id="obj"><table><tr><td>Something here</td></tr></table></div></body>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...