ÓÃJavaScriptÒþ²Ø¿Ø¼þµÄ·½·¨£¨×ª£©
ÓÃJavaScriptÒþ²Ø¿Ø¼þµÄ·½·¨ÓÐÁ½ÖÖ£¬·Ö±ðÊÇͨ¹ýÉèÖÿؼþµÄstyleµÄ“display”ºÍ“visibility”ÊôÐÔ¡£µ±style.display="block"»òstyle.visibility="visible"ʱ¿Ø¼þ»ò¼û£¬µ±style.display = "none"»òstyle.visibility = "hidden"ʱ¿Ø¼þ²»¿É¼û¡£²»Í¬µÄÊÇ“display”²»µ«Òþ²Ø¿Ø¼þ£¬¶øÇÒ±»Òþ²ØµÄ¿Ø¼þ²»ÔÙÕ¼ÓÃÏÔʾʱռÓõÄλÖ㬶ø“visibility”Òþ²ØµÄ¿Ø¼þ½ö½öÊǽ«¿Ø¼þÉèÖóɲ»¿É¼ûÁË£¬¿Ø¼þÈÔȻռ¾ãÔÀ´µÄλÖá£
<p>
<input id='control' value="ÏëÒªÒþ²ØµÄ¿Ø¼þ">
</p>
<p>
Òþ²ØÉÏÃæµÄ¿Ø¼þ£¬²¢Ê¹Æä²»Õ¼ÓÃÒ³ÃæÉϵÄλÖÃ
<input type="button" value='Òþ²Ø' onclick='displayHide_control()'>
<input type="button" value='ÏÔʾ' onclick='displayShow_control()'>
<br />
½ö½öÒþ²Ø¿Ø¼þ£¬ÆäλÖÃÈÔȻռÓÃ
<input type="button" value='Òþ²Ø' onclick='visibilityHide_control()'>
<input type="button" value='ÏÔʾ' onclick='visibilityShow_control()'>
</p>
<script language="javascript" type="text/javascript">
function displayHide_control()
{
var _control = document.getElementById("control");
_control.style.display="none";
}
function displayShow_control()
{
var _control = document.getElementById("control");
_control.style.display="block";
}
function visibilityHide_control()
{
var _control = document.getElementById("control");
_control.style.visibility="hidden";
}
function visibilityShow_control()
{
var _control = document.getElementById("control");
_control.style.visibility="visible";
}
</script>
Ïà¹ØÎĵµ£º
ÄÚ²¿Êý×é
ÔÚJavaÖÐΪÁË·½±ãÄÚ²¿¶ÔÏóµÄ²Ù×÷,¿ÉÒÔʹÓô°Ìå(Forms)¡¢¿ò¼Ü(Frames)¡¢ÔªËØ(element)¡¢Á´½Ó(links)ºÍê(Anchors)Êý×éʵÏÖ¶ÔÏóµÄ·ÃÎÊ¡£
¡¡anchors[]:ʹÓá¶A name=“anchorName“¡·±êʶÀ´½¨Á¢ÃªµÄÁ´½Ó¡£
¡¡links[]: ʹÓÃ<A href=”URL”>À´¶¨ÒåÒ»¸öÔ½Îı¾Á´½ÓÏî¡£
¡¡Forms[]: ÔÚ³ÌÐò ......
ÔÎÄ£ºÁõÎä|JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ2-showModalDialog
ǰһƪÎÄÕÂJavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«ÖµÖн²µ½ÁËÈçºÎÀûÓÃwindow.open()·½·¨´ò¿ªÐ´°Ì壬²¢ÔÚÁ½¸ö´°ÌåÖ®¼ä´«ÖµµÄ·½·¨¡£javascriptÖл¹ÓÐÒ»¸öº¯Êýwindow.showModalDialogÒ²¿ÉÒÔ´ò¿ªÒ»¸öд°Ì壬²»¹ýËû´ò¿ªµÄÊÇÒ»¸öģ̬´°¿Ú£¬ÄÇôÈçºÎÔÚ¸¸´°Ì ......
×î¶ÌµÄÍ϶¯´úÂë
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script l ......
var docEle = function() {
return document.getElementById(arguments[0]) || false;
}
function cloDiv(){
var overlayID="overlay";
var msgID = "overlayMsg";
document.body.removeChild(docEle(overlayID));
document.body.removeChild(docEle(msgID));
}
function openNewDiv() {
......