点击表格行(学生姓名)时显示对应的层(学生信息),当点击其他行时原层的隐藏有关问题

WBOY
Release: 2016-06-13 13:10:42
Original
920 people have browsed it

点击表格行(学生姓名)时显示对应的层(学生信息),当点击其他行时原层的隐藏问题
效果:点击表格行(学生姓名)时显示对应的层(学生信息),当点击其他行时原层隐藏,显示其对应的层。
问题:表格

中有onclick可以实现显示层,如何做出类似onblur失去焦点时隐藏层的操作。
代码:
JavaScript:
JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->function ShowChosen(divID){
    divID.style.display='block';
    div=divID;
}

function selectRow(rowID) 
{ 
var tStu = document.getElementById("tblStudent") 
for(var i=0;i<tstu.rows.length if rowid tstu.rows resumerowover resumerowout else function rowover row.bgcolor="#DCD8BF" rowout hidechosen divid.style.display="none"></tstu.rows.length>
Copy after login


表格:
HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
Copy after login



层:
HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
        
Copy after login

说明:之前使用单选按钮组,onclick时ShowChosen(),onblur时HideChosen(),但是又想有表格的效果,而且单选按钮也无法隐藏掉;
原本的思路是在selectRow()中,当行没被点中时用HideChosen()的,但是HideChosen();是用不了的,括号里面值的问题。

非常感谢!

------解决方案--------------------
怎么不用jquery写呢
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!