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);
    }
    }


    纠正错误,欢迎探讨:
    打开微信-发现-扫一扫
  • 相关阅读:
    Asp.net读取AD域信息的方法(一)
    登录时记住用户名和密码及cookie案例应用
    Web项目,要求:保存用户名和密码在Cookie中,下次登录不再重新输入
    ASP.net 学习路线(详细)
    vs调试技巧(二)
    vs断点调试技巧(一)
    flexPaper +swftools实现文档在线阅读
    OC 类 的声明
    OC extern和函数
    OC extern和变量
  • 原文地址:https://www.cnblogs.com/backuper/p/1499425.html
Copyright © 2011-2022 走看看