This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14451 - //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
Summary: //Arrays for each submenu var JButton_oBg = new Array(); var JButton_oMenu = ...
Status: RESOLVED INVALID
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-13 15:49 UTC by contributor
Modified: 2011-10-13 18:10 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2011-10-13 15:49:39 UTC
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