If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

The browser cache may need to be cleared and/or the page refreshed to see changes.

If there are any problems, just lest me know.

Or you can have an inc, but then it gets hard to drag the crawler. You drag it, then if you reposition the mouse to get a better hold on it to drag it farther, it starts moving again. But you can setup a toggle button to turn it on and off. If you want to know how that works, just ask.

Last edited by jscheuer1; 07-11-2013 at 09:15 AM.
Reason: code improved, English usage

The Following User Says Thank You to jscheuer1 For This Useful Post:

WOW. This is working great! Thank you.
I was also wondering if there is a way to dynamically update the marquee as you click so we can add the images 1 at a time?
I have this simple javascript code I have written and I have an onclick attribute in the div.
<div class="marquee" id="scroller" style="overflow: hidden;" onclick="loadImage(this);">
Is there a way to modify the code to these specifications?

The only two ways to add an image or images to the crawler once it's there I can think of are to either insert them into the crawler as it is (it's no longer .marquee#scroller, and has two internal divs that contain duplicate trains of images, so the image would have to be cloned and put into each of those) and then running the scripts resize function. Or, completely removing the crawler as it is, replacing it with what it was before it was initialized, which would have had to have been saved, then adding the image and reinitializing it. I actually have done something like the latter before and it works. The former would be tidier for your purposes, but would require further customization of the script, and I'm not certain it would be workable. When I have more time I will look into it.

I have to break for lunch, then errands, then some things around the house that need attention. So later tonight or tomorrow. Maybe over the weekend. If it doesn't work, I'll show you how to save, remove, reinit.

OK, I tried with only updating the content and then resizing. It didn't work. Then I decided to make updating via the other method I mentioned (removing and replacing the crawler) a part of the script. In so doing I noticed a lot of other things I wanted to change. But to make a long story short (or at least shorter than it would be if I went into all of that), for what you're asking, use the latest alpha version of the script (not all of the latest changes are documented in its comment section, right click and 'Save As'):

But I would advise against adding all that style to it. The script will style the image so that it behaves properly in the crawler. However, it's fine to set the width and height of the image, even required if the dimensions you are setting are different than the image's native dimensions.

There are other ways. You can add an image by its id if it's already on the page, perhaps in a hidden div. Or you can add an entire div full of images by its id if it's a div on the page (again, perhaps hidden) - only the images will be added:

Or you can create a div element, fill it with created img elements and use a reference to the div element, all of its images will be added:

Code:

crawler1 = crawler1.update(reference_to_the_created_div);

Other things you can do are change the default options for the crawler, like its mouse, style, moveatleast, inc, etc., properties (any of the properties that can be set when you first create a crawler, except of course its uniqueid property) by adding an options object after the new content:

Finally, you can specify a third parameter 'horizontal' or 'vertical' to change the orientation of the crawler (it's dimensions via its style object option should probably be changed as well if you want to do this, and the layout of the page would have to be flexible enough or at least have room enough for the changed direction crawler).

But, as I say, for what you asked for, simply adding an image, just create it and add a reference to it using the update function (first example above).

One thing you may have noticed is that I used mouse: 'drag cursor driven' Drag can now be used by itself or combined with either 'pause' or 'cursor driven'