#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    33
    Rep Power
    11

    Question hide text + show hidden image/object with just one click


    With the help of you guys i had solved a couple of troubles i had with this page, this is the last one.
    I have:
    this styles:
    Code:
    <style type="text/css">
    <!--
    #img2 {position:relative; top:80; left:-25}
    -->
    </style>
    
    <style>
    #dis {position:relative; top: 80; left: -25}
    </style>
    this fuctions:
    Code:
    <script language="JavaScript">
    <!--
    var ie45,ns6,ns4,dom;
    if (navigator.appName=="Microsoft Internet Explorer")
      ie45=parseInt(navigator.appVersion)>=4;
    else if (navigator.appName=="Netscape"){
      ns6=parseInt(navigator.appVersion)>=5;
      ns4=parseInt(navigator.appVersion)<5;}
    dom=ie45 || ns6;
    
    function showhide(id) {
    el = document.all ? document.all[id] : 
      dom ? document.getElementById(id) : 
      document.layers[id];
    els = dom ? el.style : el;
    if (dom){
      if (els.visibility == "hidden")
        els.visibility = "visible";
      }
    else if (ns4){
      if (els.visibility == "hide")
        els.visibility = "show";
      }
    location.href='/EbusFerraraWeb/OrdenesCompra.do?origen=<%=EbusinessIntranetFerraraInterface.FLAG_ORIGEN_YANAC%>';
    
    }
    function showhide2(id) {
    el = document.all ? document.all[id] : 
      dom ? document.getElementById(id) : 
      document.layers[id];
    els = dom ? el.style : el;
    if (dom){
      if (els.visibility == "hidden")
        els.visibility = "visible";
      }
    else if (ns4){
      if (els.visibility == "hide")
        els.visibility = "show";
      }
    location.href='/EbusFerraraWeb/OrdenesCompra.do?origen=<%=EbusinessIntranetFerraraInterface.FLAG_ORIGEN_SOUTH%>';
    
    }
    
    function hide() {
    dis.style.display='none'
    }
    
    //-->
    </script>
    this is the rest of code important to this matter:
    Code:
    <DIV id="dis"><TABLE align="left">
    <TBODY>
       <TR>
           <TD width="150"></TD>
           <TD><a href="#" onclick="showhide('img2');return false">Yanac</A></TD>
      </TR>
      <TR>
           <TD width="150"></TD>
           <TD><a href="#" onclick="showhide2('img2');return false">South</A> <a href="javascript:hide()">Hide text!</a></TD>
       </TR>
    </TBODY>
    </TABLE></DIV>
    and i want to use both fuctions with a single link, is there any way to do this?


    the effect i want to archive is the next... when the user clicks in the link, the links dissapears and in the same moment a hidden swf appears.. I can make that happen but doing 2 clicks and that is not what i want...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    Lawrence, Kansas [KU]
    Posts
    1,559
    Rep Power
    15
    you can put two function calls on one event...isn't that all you want to do? just make sure they end in a semi-colon...
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    33
    Rep Power
    11
    Originally Posted by jacktasia
    you can put two function calls on one event...isn't that all you want to do? just make sure they end in a semi-colon...
    mmmm... thanks but how i do that?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    Lawrence, Kansas [KU]
    Posts
    1,559
    Rep Power
    15
    just how it sounds:

    Code:
    onclick="showhide2('img2');hide();"
    i am assuming those are the two functions you want to use.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    33
    Rep Power
    11
    lol that worked... (i just have to make position adjusts)

    the weir thing is that i tried to do that before... but i think i forgot to erase the "return false"... what being sleepy does...

    thank you!

IMN logo majestic logo threadwatch logo seochat tools logo