Go Back   Dynamic Drive Forums > General Coding > JavaScript
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #11  
Old 11-02-2009, 02:30 AM
sevrinsevrin sevrinsevrin is offline
Junior Coders
 
Join Date: Nov 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Holy Cow, I have everything but the direction working:

http://www.coreyshead.com/beta/monstersandrobots.html

(the only lightbox item, at this point, is a yellow, tentacled icon in the top row - but it works!)

Strangely, the crawler script's "direction" parameter (direction: 'right', ('right' or 'left') ) doesn't seem to effect the direction of the script. I even tried it on a single string in a bare page but the crawl remained obstinate, heading off to the left no matter what. (I presently have the directions set to stagger the flow for the hell of it - if you tap the 2nd and fourth string on the left, you'll get the effect I am hoping for - disconcerting but I like it).

If you have any ideas for the directional aspect, I'd be interested but, heck, I'm 90% home as it is so: Thanks for all your help!
Reply With Quote
  #12  
Old 11-02-2009, 05:43 AM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,005
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

Pretty cool. You've done a nice job.

In no particular order, three things:

You've misunderstood direction. It is not a style, rather a distinct property of the crawler instance:

Code:
<script type="text/javascript">
marqueeInit({
	uniqueid: 'mycrawler',
	style: {
		'padding': '10px',
		'width': '800px',
		'height': '110px'
	},
	inc: 8, //speed - pixel increment for each iteration of this marquee's movement
	mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
	moveatleast: 1,
	neutral: 150,
	direction: 'right',
	savedirection: false
});
</script>
NOT:

Code:
<script type="text/javascript">
marqueeInit({
	uniqueid: 'mycrawler',
	style: {
		'padding': '10px',
		'width': '800px',
		'height': '110px',
		'direction': 'right'
	},
	inc: 8, //speed - pixel increment for each iteration of this marquee's movement
	mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
	moveatleast: 1,
	neutral: 150,
	savedirection: false
});
</script>
The default direction if not specified is left.

Second, this bit:

Code:
<script type="text/javascript">
LightboxOptions.startCallback = function(){
	for(var i = 0; i < ConveyorBelt.ar.length; ++i){
		ConveyorBelt.ar[i].copyspeed = 0;
		ConveyorBelt.ar[i].halt = true;
	}
};
LightboxOptions.startCallbackType = 'afterUpdate';
LightboxOptions.endCallback = function(){
	for(var i = 0; i < ConveyorBelt.ar.length; ++i){
		ConveyorBelt.ar[i].copyspeed = ConveyorBelt.ar[i].speed;
		ConveyorBelt.ar[i].halt = false;
		if(ConveyorBelt.ar[i].stp){
			ConveyorBelt.ar[i].mousereact.onmouseover();
		}
	}
};
Event.observe(window, 'load', function(){
	for(var i = 0; i < ConveyorBelt.ar.length; ++i){
		(function(mh, c){
			document.observe('mousemove', function(e) {
				var x = e.pointerX(), y = e.pointerY(), co = mh.cumulativeOffset(), gd = mh.getDimensions();
				c.stp = false;
				if(x > co.left && x < gd.width + co.left && y > co.top && y < gd.height + co.top){
					c.stp = true;
				}
			});
		})($(ConveyorBelt.ar[i].mouseholder), ConveyorBelt.ar[i]);
	}
});
</script>
Doesn't do anything with crawler and is causing an error(s), might as well get rid of it. It was for conveyor, to stop the conveyors and resume them visa vis lightbox activation. Crawler works differently, so the same logic might not apply even if adapted to crawler. But it looks like the page is more fun with the monsters continuing to move underneath the overlay than it would be if they stopped. Don't you agree?

Third, there appear to be some errors on the page unrelated to the two above considerations, but I cannot be sure until you deal with the above.
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Reply With Quote
  #13  
Old 11-02-2009, 01:51 PM
sevrinsevrin sevrinsevrin is offline
Junior Coders
 
Join Date: Nov 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

> the page is more fun with the monsters continuing to move underneath the overlay

I think it's about the worst form of image nav I've ever seen but the point is to be graphically interesting and, at the same time, sort of a carnival duck-shoot, if you know what I mean so, yeah, it is suiting my needs absolutely - and Thank You for helping me to realize such a boneheaded idea!

> You've misunderstood direction

Ah! I wondered about that but apparently never checked my suspicions. The instructions for the script made it seem like it most of the variables were styles. At least to a neophyte. =) Thank you. (I wonder what else I got wrong - I'll do some more pokin')

> Second ... Doesn't do anything with crawler

Hah! I wondered about that, too. After posting here I realized my drop-downs were no longer working on the page (here they do: http://www.coreyshead.com/beta/index.html ), so I did some script rearranging in the head and discovered that removing that chunk had no effect - neither good nor bad! Never realizing that it was for Conveyor, not Crawler! Duh ...

In any case, it seems like the conflict is somewhere between Lightbox and the dropdowns as I can activate one or the other by putting the one I wish to work lower in the head stack.

Now I've seen Lightbox work with these dropdowns so I'm left with the conclusion that a) I am, in fact, asking an awful lot, here or b) I've got it wrong, again!

Thanks for your help!
Reply With Quote
  #14  
Old 11-02-2009, 02:24 PM
jscheuer1's Avatar
jscheuer1 jscheuer1 is offline
No Kidding?
 
Join Date: Mar 2005
Location: SE PA USA
Posts: 19,005
Thanks: 19
Thanked 1,135 Times in 1,121 Posts
Blog Entries: 3
Default

There is a conflict with jQuery and Prototype. The way you currently have it on the page, the order of the scripts is correct. The jQuery scripts should come first. And since your menu script is so simple (or at least short), it can easily be made not to conflict by changing how it begins(changes and addition highlighted red):

Code:
// JavaScript Document

//doesn't come with versioning, so I dub this 1.1 (I made some tweaks)!
jQuery(document).ready(function($){

	$("li.haschild").addCl . . .
I also found one other error which will oly effect some browsers. For this crawler (mycrawler4):

Code:
<script type="text/javascript">
marqueeInit({
	uniqueid: 'mycrawler4',
	style: {
		'padding': '10px',
		'width': '800px',
		'height': '110px',
	},
	inc: 5, //speed - pixel increment for each iteration of this marquee's movement
	mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
	moveatleast: 1,
	neutral: 150,
	direction: 'right',
	savedirection: true
});
</script>
See the above highlighted red comma. It is technically invalid (no trailing commas allowed internally after the last item or property in an array or object), but most browsers will error correct that for you. IE is one that will not, so it should be removed.

Oh, and BTW - I was right, this page is pretty CPU intensive with all the constant screen rewrites, so you may still want to consider less (in this case) crawlers and disabling the animations in Lightbox. Though it only gets really bad when more than one page of it is open at a time. However, this would be the same as having your one page open and some other CPU intensive operation going on anywhere else in the browser or the computer in general.
__________________
WWWWWWWWWWWW
- John
________________________

Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Last edited by jscheuer1; 11-02-2009 at 02:31 PM.
Reply With Quote
  #15  
Old 11-02-2009, 03:08 PM
sevrinsevrin sevrinsevrin is offline
Junior Coders
 
Join Date: Nov 2009
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

> there is a conflict / See the above

Thank you but again! It is as I had imagined it could be.

> this page is pretty CPU intensive with all the constant screen rewrites

Yeah, I noticed that when I was testing. Maybe three rows instead of five (gotta keep that balance) and/or nix the animation. I'll play with it - THANK YOU!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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. The time now is 06:43 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.