Jump to content
php.lv forumi
  • 0

visibility hidden, bet height paliek.


anonīms

Question

fast reply pogu vajag forumam. (jquery netiek izmantots kā suga lapā)

function fast_reply()
{
 var divstyle = new String();        
 divstyle = document.getElementById("fast_reply").style.visibility;        
   if(divstyle.toLowerCase()=="visible" || divstyle == "")        
   {            
   document.getElementById("fast_reply").style.visibility = "hidden";        
   }        
   else        
   {           
   document.getElementById("fast_reply").style.visibility = "visible";        
   }
}

html

                       echo '<div id="fast_reply" style="visibility:hidden;';
                      include "post.php";
                      echo '</div>';

 

Problēma ir tur, ka viss, kas ir iekšs #fast_reply nerādas, kad ir neredzams, bet viņa augstums uzreiz ir fiksēts un sanāk, ka tur vnk ir balts klucis. Kā varētu to atrisināt?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

hmm, kāpēc naiziet atpakaļ uz none?

 

parādīt parāda, bet, kad gribu atkal paslēpt, tad nevar

alert(document.getElementById("fast_reply").style.display);
     if(document.getElementById("fast_reply").style.display = 'none')
     {
       document.getElementById("fast_reply").style.display = 'block';
     }
     else //if(document.getElementById("fast_reply").style.display = 'block')
     {
       document.getElementById("fast_reply").style.display = 'none';
     }

}

alert = none/block

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...