function high() { 
highlighting=window.setInterval("highlightit()",1000);} 

解决方案 »

  1.   

    这样也不行 我试过了 又报缺少对象 能将setInterval详细地介绍一下吗
      

  2.   

    highlighting=window.setInterval("highlightit()",1000);

    highlighting=window.setInterval(highlightit,1000);还有个问题
    若hightlightit()不是类的成员函数
    function highlightit(){ 
    this.filters.alpha.opacity+=30 
    }函数里的this js解析不了.
    不如具体将元素的id写出来,代替this如果hightlightit()是类的成员函数
    则setInterval应这样写:
    window.setInterval("obj.highlightit()",1000);
    其中obj是实例化的对象.
    --------------------------------------------------------------------------------
    setInterval Method
    --------------------------------------------------------------------------------Evaluates an expression each time a specified number of milliseconds has elapsed.SyntaxiTimerID = window.setInterval(vCode, iMilliSeconds [, sLanguage])ParametersvCode Required. Variant that specifies a function pointer or string that indicates the code to be executed when the specified interval has elapsed. 
    iMilliSeconds Required. Integer that specifies the number of milliseconds. 
    sLanguage Optional. String that specifies any one of the possible values for the LANGUAGE attribute. Return ValueInteger. Returns an identifier that cancels the timer with the clearInterval method. 
      

  3.   

    是这样 实际上这是个htc文件 alpha.htm
    <STYLE>
    .alpha {
    behavior:url(alhpa.htc);
    FILTER: alpha(opacity=40);
    }
    </STYLE>
    <IMG src="Data.gif" class=alpha   width="167" height="260">-----------------------------------------------------------------------
    alpha.htc
    <PUBLIC:COMPONENT TAGNAME="alpha" LIGHTWEIGHT> 
    <PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="high()" />
    <PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="low()" />
    <!--<PUBLIC:ATTACH EVENT="onclick" ONEVENT="goUrl()" />-->
    <SCRIPT language=javascript>
    var highlighting=""
    function high() { 
    highlighting=window.setInterval(highlightit(),1000);
    } function low(){ 
    clearInterval(highlighting) 
    this.filters.alpha.opacity=40 } function highlightit(){  this.filters.alpha.opacity+=30 } 
    </SCRIPT>
    ----------------------------------------------
    我都试了 还是报错
      

  4.   

    function high() { 
    highlighting=window.setInterval(highlightit(),1000);

    ---------------------------------------
    这个肯定是不行的,一定要双引号的。如果hightlightit()是类的成员函数
    则setInterval应这样写:
    window.setInterval("obj.highlightit()",1000);
    其中obj是实例化的对象.
    -----------------------------------------
    这个一般来说也会错误的,因为执行的时候obj这个变量到运行的时候可能已经不存在了。
    --------------------------------------------------------------如果你面对的浏览器的版本>ie5.0,建议你是用微软的HTML+TIME,它能完成你的功能,并且用setInterval这样的东西,总是难以控制的,特别是和样式改变有关的时候。相关的内容可以参见:
    http://msdn.microsoft.com/workshop/author/behaviors/reference/time2/htime_node_entry.asp?frame=true
      

  5.   

    把highlighting=window.setInterval(highlightit,1000); 可以了