Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help conver VBscript to JavaScript

Status
Not open for further replies.

PhotoJoe

Technical User
Jul 6, 2002
1
US
I hope someone can help me with this. I trying to convert some VBscript to JavaScript so that a webpage will be cross browser viewable.

I think I have most of this figured out. But in the code below that I marked in red is what I don't understand. Could someone help convert this to javascript or maybe tell me what the varibale "data" would containg?

Here is the code for a sub that I'm trying to convert:

Code:
REM Initialize
sub setUp()
	REM Get window dimensions
	wW=w.clientWidth
	wH=w.offsetHeight
	sH=w.scrollHeight
	REM Set the scroll Height
	bH=wH
	if sH>wH then bH=sH
	for i=1 to borders
		y(i)=-(pH(i))
		REM Set margins
		w.style.marginLeft=pW(1)
		w.style.marginRight=pW(2)
		chkPics(i)=numPics(i)
		REM Adjust number of pics for message length
		if int(bH/pH(i))>numPics(i) then
			chkPics(i)=int(bH/pH(i))+3
			data=""
			for j=numPics(i)+1 to chkPics(i)

data=data&&quot;<IMG src='&quot;&document.all(&quot;bkg&quot;&i).src&&quot;'>&quot;
next
document.all(&quot;box&quot;&i).insertAdjacentHTML &quot;BeforeEnd&quot;, data
Code:
		end if
		REM Limit visible area
		document.all(&quot;container&quot;&i).style.width=pW(i)
		document.all(&quot;container&quot;&i).style.height=bH
		if i=1 then
			document.all(&quot;container&quot;&i).style.left=0
		else
			document.all(&quot;container&quot;&i).style.left=wW-pW(i)
		end if
		document.all(&quot;container&quot;&i).style.top=0
		REM Set the size of the scrolling area
		document.all(&quot;box&quot;&i).style.height=bH+3*pH(i)
		document.all(&quot;box&quot;&i).style.width=pW(i)
		document.all(&quot;box&quot;&i).style.left=0
		document.all(&quot;box&quot;&i).style.top=y(i)
	next
	if calcFlag=1 then
		calcFlag=0
		setUp
	end if
	REM Start the scroll.
	SF
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top