News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > BeyondUnreal > Off Topic

Reply
 
Thread Tools Display Modes
Old 1st Jan 2004, 03:57 PM   #1
Thrash123
Obey Leash Laws
 
Thrash123's Avatar
 
Join Date: Jul. 19th, 1999
Location: Nowhere to be found.
Posts: 4,773
Need some javascript assistance.

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);
	}
  }
__________________
My Portfolio | My Music

Last edited by Thrash123; 1st Jan 2004 at 11:39 PM.
Thrash123 is offline   Reply With Quote
Old 1st Jan 2004, 06:25 PM   #2
Thrash123
Obey Leash Laws
 
Thrash123's Avatar
 
Join Date: Jul. 19th, 1999
Location: Nowhere to be found.
Posts: 4,773
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.
__________________
My Portfolio | My Music

Last edited by Thrash123; 1st Jan 2004 at 06:39 PM.
Thrash123 is offline   Reply With Quote
Old 1st Jan 2004, 09:31 PM   #3
Thrash123
Obey Leash Laws
 
Thrash123's Avatar
 
Join Date: Jul. 19th, 1999
Location: Nowhere to be found.
Posts: 4,773
Ok, nevermind on the header fix, I got it all working now. I just need to figure out what I am going to do about the scroller schtuff.
__________________
My Portfolio | My Music
Thrash123 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:51 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer