Need some javascript assistance.

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Thrash123

Obey Leash Laws
Jul 19, 1999
4,777
0
36
40
Nowhere to be found.
www.classicwfl.com
Ok, I just started into Javascript. I have an older reference book that has been helping me with syntax, but I have a question. My searches on Google can't seem to answer this, so I'd though I would toss it out here since I have other things I need to do. I'm a C++ coder myself, so I don't need a Javascript primer, just help figuring out how to go about this.

Ok, lets say this... I have a table, 2 buttons, and an iframe in a cell in that table. the 2 buttons are outside the iframe. I want to disable the ordinary scrollbar, and have one button scroll the iframe down when clicked, and the other scroll up when clicked. I want it to work like the normal scroll buttons - when you hold down the button, it keeps scrolling. It'll stop, obviously, whenever you release the mouse button.

Alternatively, I could go with the mouseover scrolling like @ www.sonicmayhem.com - however I don't like mouseover scrolling.

So, gimme some code. If you could comment it for me I'd appreciate it, but it's not necessary since I already have a decent knowledge when it comes to the commands in Javascript pretty well (and have a decent resource at my disposal). I'll give you credit in the source code for whoever helps a reasonable amount ;)

*update, after the below 2 posts because I didn't want to feel guilty about bumping it again :)*

Ok, here is the source code of the concept for the scroller. When the Scroller function is called, it is passed a number (which determines the direction). When the mouse button is released, it will try to break the loop. However, I get an infinite loop (lockup) whenever I click on one of the buttons - presumeably because it's not capturing the mouseup event. I'm stumped. This is my first javascript stuff though :)

Code:
  var Counter = 0;

  window.captureEvents(Event.MOUSEUP);

  function handle(evnt)
  {
	Counter = 123;
	return true;
  }

  function Scroller(intDir)
  {
	while(Counter == 0)
	{
	  if (intDir == 1)
	    mainiframe.scrollBy(0,-10);
	  else
	    mainiframe.scrollBy(0,10);
	}
  }
 
Last edited:

Thrash123

Obey Leash Laws
Jul 19, 1999
4,777
0
36
40
Nowhere to be found.
www.classicwfl.com
You can see what I have done so far here. The only thing I can't figure out is how to get it to continue to scroll while I hold down the mouse button (Note: That content is test content - that isn't going to be the layout inside the page at all).

http://members.peoplestar.net/dcp@peoplestar.net/

I was also trying to make headway on my date & time header, but I can't get it to work either. If someone could debug that for me I'd appreciate it :)

*edit*

FUDGEMONKGER. JUDASMONKIES.

Tripod breaks the scoller buttons in Moz FB 0.6.1 - Whenever you click one, it thinks you are leaving a tripod webpage - so it gives you a nice popup. Well, that breaks the scollers! It works in IE, and it works when opened from my HDD, so I'm thinking it has to be tripod. I'm going to try it in some of my banner and popup free webspace... GAH.

*edit again*

Uploaded to other webspace, check above URL again.
 
Last edited: