zoukankan      html  css  js  c++  java
  • netsuite 子标签 tab 显示原理

    function isTabShown(tname) {
    return document.all[tname+'_div'] == null || document.all[tname+'_div'].style.visibility == 'visible'; }

    用来校验是否显示的状态。

    下面这个在IE7中都能兼容:

    function ShowHideTab(tname,shown) {
    if (document.all[tname+'_div'] == null || document.all[tname+'_div'].style.visibility == (shown ? 'visible' : 'hidden')) return;
    document.all[tname+'_div'].style.zIndex = shown ? 2 : -1;
    document.all[tname+'_wrapper'].style.zIndex = shown ? 1 : -1;
    var machs = allmachs[tname].split(',')
    var mach = vismachs[tname]
    var dotmachs = '';
    if (shown) {
    var i
    for (i=0;i<machs.length;i++) {
    var dotmach = machs[i];
    if (dotmach != null && dotmach != mach && document.all[dotmach+'_layer'] != null && document.forms.main_form.elements[dotmach+'dotted'] != null && document.forms.main_form.elements[dotmach+'dotted'].value=='F')
    dotmachs += (dotmachs.length > 0 ? String.fromCharCode(5) : '')+dotmach;
    } }
    if (shown && mach != null && document.all[mach+'_layer'].style.visibility != 'hidden' && document.all[mach+'_layer'].style.display != 'none' && document.forms.main_form.elements[mach+'loaded'] != null && document.forms.main_form.elements[mach+'loaded'].value=='F') refreshmachine(mach, null, true, dotmachs.length > 0 ? dotmachs : null );
    else if (shown && dotmachs.length > 0) refreshmachine(null, null, true, dotmachs )
    document.images[tname+'lti'].src=document.images[tname+'lti'].src.replace(shown ? /_plain/ : /_stroked/,shown ? '_stroked' : '_plain');
    document.images[tname+'rti'].src=document.images[tname+'rti'].src.replace(shown ? /_plain/ : /_stroked/,shown ? '_stroked' : '_plain');

    var tabDiv = document.all[tname+'_div']
    tabDiv.style.visibility = shown ? 'visible' : 'hidden';
    tabDiv.style.display = shown ? 'block' : 'none';
    document.all[tname+'lt'].className = shown ? 'bgontabbottom' : 'bgofftabbottom';
    document.all[tname+'lnk'].className = shown ? 'bgontabbottommid' : 'bgofftabbottommid';
    document.all[tname+'rt'].className = shown ? 'bgontabbottom' : 'bgofftabbottom';
    document.all[tname+'txt'].className = shown ? 'smalltextnolink' : 'smallgraytextnolink';
    if(shown) {
    document.forms['main_form'].elements['selectedtab'].value = tname;
    tabDiv.className = 'bgontabbottom';
    if ( mach != null ) sizeLowerTabBGDiv(mach);
    }
    }


    纠正错误,欢迎探讨:
    打开微信-发现-扫一扫
  • 相关阅读:
    Layui的一些心得
    Oracle工具PLSQL
    .NET开发中 springMVC+NHibernate注入失败的几个常见错误
    配置好运行后Error creating context 'spring.root': Could not load type from string value
    css样式添加错误导致烦扰
    Oracle时间与系统不同步,TimeStampService
    前端入门10-JavaScript语法之对象
    前端入门9-JavaScript语法之运算符
    前端入门8-JavaScript语法之数据类型和变量
    前端入门7-JavaScript语法之相关术语
  • 原文地址:https://www.cnblogs.com/backuper/p/1499425.html
Copyright © 2011-2022 走看看