大家好,我有IE10和chrome的问题。在扩展表后,IE10不会崩溃,对于chrome,它会在它之间留下空白..在ie8,firefox中工作。我已经尝试display:none并显示:table-row ..但它只适用于IE 10 ..
这是javascript代码
function loadSessionLogEvents(id) {
var visibility = $('eventTR' + id).style.visibility;
if (visibility == 'collapse')
{
$('eventTR' + id).style.visibility = 'visible';
var tURL = '<%=request.getContextPath()%>/home/Folder.action?listSessionLogEvents=&sessionLogId=' + id;
new Ajax.Updater($('detailTR' + id), tURL, {
method: 'get',
evalScripts: 'hidden'
});
} else {
$('eventTR' + id).style.visibility = 'collapse';
}
}
所以改变之后的代码应该是这样的吗?
function loadSessionLogEvents(id) {
var visibility = $('#eventTR' + id).css('visibility');
if (visibility == 'collapse')
{
$('eventTR' + id).css('visibility','');
var tURL = '<%=request.getContextPath()%>/home/Folder.action?listSessionLogEvents=&sessionLogId=' + id;
new Ajax.Updater($('detailTR' + id), tURL, {
method: 'get',
evalScripts: 'hidden'
});
} else {
$('eventTR' + id).css('visibility','collapse');
}
}
这是clickbutton函数
href =“#”onclick =“javascript:loadSessionLogEvents('$ {file.session.id}')”&gt;
答案 0 :(得分:0)
根据评论,这里存在多个问题
eventTR
和detailTR
元素style
的属性,您需要使用.css()来获取和设置css值尝试
function loadSessionLogEvents(id) {
var $tr = $('#eventTR' + id);
var visibility = $tr.css('visibility')
if (visibility == 'collapse') {
$tr.css('visibility', 'visible')
var tURL = '<%=request.getContextPath()%>/home/Folder.action?listSessionLogEvents=&sessionLogId=' + id;
new Ajax.Updater($('#detailTR' + id), tURL, {
method: 'get',
evalScripts: 'hidden'
});
} else {
$tr.css('visibility', 'collapse')
}
}