[Bug 14451] New: //Arrays for each submenu var JButton_oBg = new Array(); var JButton_oMenu = new Array(); //Default browsercheck, added to all scripts! function JButton_checkBrowser(){ this.ver=navigator.appVersion; this.dom=document.getElementById?1:0; this.ie5=(this.ve

http://www.w3.org/Bugs/Public/show_bug.cgi?id=14451

           Summary: //Arrays for each submenu var JButton_oBg = new
                    Array(); var JButton_oMenu = new Array(); //Default
                    browsercheck, added to all scripts! function
                    JButton_checkBrowser(){ this.ver=navigator.appVersion;
                    this.dom=document.getElementById?1:0;
                    this.ie5=(this.ve
           Product: HTML WG
           Version: unspecified
          Platform: Other
               URL: http://www.whatwg.org/specs/web-apps/current-work/#top
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P3
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: contributor@whatwg.org
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


Specification: http://dev.w3.org/html5/spec/Overview.html
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
//Arrays for each submenu
var JButton_oBg = new Array();
var JButton_oMenu = new Array();

//Default browsercheck, added to all scripts!
function JButton_checkBrowser(){
    this.ver=navigator.appVersion;
    this.dom=document.getElementById?1:0;
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5);
    return this;
}

JButton_bw=new JButton_checkBrowser();
/**************************************************************************
Variables to set.
***************************************************************************/
//The height of the menu
JButton_sMenuheight=30;

//Scroll speed: (in milliseconds, change this one and the next variable to
change the speed)
JButton_sScrollspeed=20;

//Pixels to scroll per timeout.
JButton_sScrollPx=2;

/**************************************************************************
Scrolling functions
***************************************************************************/
var JButton_tim=0;
var JButton_noScroll=true;
function JButton_reset(index)//by Julian
{
    JButton_oMenu[index].y=0
    JButton_oMenu[index].css.top=0;
}

function JButton_moveTop(index)
{
    if(!JButton_noScroll && parseInt(JButton_oMenu[index].y)<0)
    {
        JButton_oMenu[index].moveBy(0,JButton_sScrollPx);

JButton_tim=setTimeout("JButton_moveTop('"+index+"')",JButton_sScrollspeed);
    }
}

function JButton_moveBottom(index)
{
    var h =
document.getElementById("JButton_divScroll_ctl00_mBtnTransparentFilter").offse
tHeight;
    var b =
parseInt(JButton_oMenu[index].y)>-(JButton_oMenu[index].scrollheight-(h));

    if(!JButton_noScroll &&
parseInt(JButton_oMenu[index].y)>(JButton_oMenu[index].pageHeight-(h)))
    {
        JButton_oMenu[index].moveBy(0,-JButton_sScrollPx);

JButton_tim=setTimeout("JButton_moveBottom('"+index+"')",JButton_sScrollspeed)
;
    }
}

function JButton_noMove()
{
    clearTimeout(JButton_tim); 
    JButton_noScroll=true;
}

/**************************************************************************
Object part
***************************************************************************/
function JButton_makeObj(obj,nest,menu)
{
    nest=(!nest) ? '':'document.'+nest+'.';
    this.css=JButton_bw.dom?
document.getElementById(obj).style:JButton_bw.ie4?document.all[obj].style:JBut
ton_bw.ns4?eval(nest+"document.layers." +obj):0;
    this.evnt=JButton_bw.dom?
document.getElementById(obj):JButton_bw.ie4?document.all[obj]:JButton_bw.ns4?e
val(nest+"document.layers." +obj):0;


this.scrollheight=JButton_bw.ns4?this.css.document.height:this.evnt.offsetHeig
ht;
    this.x=(JButton_bw.ns4 || JButton_bw.ns5)?
this.css.left:this.css.pixelLeft;
    this.y=(JButton_bw.ns4 || JButton_bw.ns5)?
this.css.top:this.css.pixelTop;
    this.moveBy=JButton_moveBy; this.moveIt=JButton_moveIt;
    this.showIt=JButton_showIt; this.clipTo=JButton_clipTo;
    this.pageHeight = pageHeight;
    return this;
}

function JButton_moveBy(x,y)
{
    this.x = parseInt(this.x) + x;
    this.y = parseInt(this.y) + y;
    this.css.left = parseInt(this.x);
    this.css.top=parseInt(this.y);
}

function JButton_moveIt(x,y)
{
    this.x=x; 
    this.y=y; 
    this.css.left=this.x; 
    this.css.top=this.y;
}

function JButton_clipTo(t,r,b,l)
{
    if(JButton_bw.ns4)
    {
        this.css.clip.top=t; 
        this.css.clip.right=r; 
        this.css.clip.bottom=b; 
        this.css.clip.left=l;
    }
    else 
        this.css.clip="rect("+t+","+r+","+b+","+l+")";
}

function JButton_showIt()
{
    this.css.visibility="visible";
}
/**************************************************************************
Object part end
***************************************************************************/

/**************************************************************************
Init function. Set the placements of the objects here.
***************************************************************************/
function JButton_scrollInit( index, pHeight )
{
    //Height of the menu
    pageHeight=pHeight;
    JButton_sMenuheight=pHeight;

    var bMenuExists=JButton_bw.dom?
document.getElementById("JButton_divContentScroll_" +
index):JButton_bw.ie4?document.all["JButton_divContentScroll_" +
index]:JButton_bw.ns4?eval(nest+"document.layers.JButton_divContentScroll_" +
index):0;

    if (bMenuExists) {
        JButton_oBg[index]=new
JButton_makeObj('JButton_divContentScroll_' + index);
        JButton_oMenu[index]=new JButton_makeObj('JButton_divScroll_'
+ index,'JButton_divContentScroll_' + index,1);
        //Placement
        if(JButton_bw.dom ||
JButton_bw.ie4){JButton_oBg[index].css.overflow="hidden";}
        JButton_oBg[index].clipTo(0,JButton_sMenuheight,pageHeight,0);

    }
}

Posted from: 200.45.142.34
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101
Firefox/7.0.1

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 13 October 2011 15:49:47 UTC