首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Cognos小结五(JavaScript)

2012-10-07 
Cognos总结五(JavaScript)1、屏蔽IE8浏览器点击折线出现热点问题scriptvar areaObjs document.getEleme

Cognos总结五(JavaScript)
1、屏蔽IE8浏览器点击折线出现热点问题
<script>
var areaObjs = document.getElementsByTagName('area');
for(var i = 0; i < areaObjs.length; i++){
       var el = areaObjs[i];
       if(el.attachEvent){ 
       el.attachEvent('onfocus', function(){
    el.blur();
           }); 
       }
}
</script>
2、Cognos报表屏蔽报表右键功能
<SCRIPT type="text/javascript">

  if(window.oCV_NS_)
   {
    window.oCV_NS_.bCanUseCognosViewerContextMenu = false;
    window.oCV_NS_.bCanUseCognosViewerSelection = false;
   }  
   if(window.oCVRS)
   {
    window.oCVRS.bCanUseCognosViewerContextMenu=false;
    window.oCVRS.bCanUseCognosViewerSelection = false;
   }

function shield_rightclk()
{
   if(window.oCV_NS_)
   {
    window.oCV_NS_.bCanUseCognosViewerContextMenu = false;
    window.oCV_NS_.bCanUseCognosViewerSelection = false;
   }  
   if(window.oCVRS)
   {
    window.oCVRS.bCanUseCognosViewerContextMenu=false;
    window.oCVRS.bCanUseCognosViewerSelection = false;
   }

}

function block(oEvent)
{
  shield_rightclk();
  if(window.event)
  {
   oEvent=window.event;
   oEvent.returnValue=false;  
  }
  else

   oEvent.preventDefault();
  }
}
document.oncontextmenu=block;

</SCRIPT>

热点排行