PDA

View Full Version : Resolved Text and image crawler fixed width problem



beaker
05-07-2010, 12:09 PM
1) Script Title: Text and image crawler

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm

3) Describe problem: According to the notes:

Marquees whose specified or default width is greater than their contents will be automatically shrunk to avoid empty spots.

Whilst this is a useful feature it is actually the opposite if what i need. I need to specify a fixed width for the marquee and if the content is not as wide as the marquee i want that gap rather than having the marquee width reduced.

I have been digging through the .js file but being completely rubbish with javascript i can't work out how to stop it shrinking the width.

Other than that the crawler is perfect for what i need and i would rather not switch to another scroller as they don't have the same "mouse driven" feature.

Any help anyone can offer would be great!

jscheuer1
05-08-2010, 03:00 AM
Browsers cannot scroll content that is too short to fill the space it is scrolling in. They will simply run out of things to show.

If you want something like that with a gap to fill out the empty space, just place a span or blank image of the desired width into the contents. For example:


<div class="marquee" id="mycrawler2">
<img src="blank.gif" width="300"><img src="http://i40.tinypic.com/9tlic8.jpg"> <img src="http://i43.tinypic.com/1zbqs5t.jpg"> <img src="http://i44.tinypic.com/2419ul3.jpg"> <img src="http://i43.tinypic.com/296nh3r.jpg"> <img src="http://i40.tinypic.com/mk7ki.jpg">
</div>

Where blank.gif is a transparent .gif image, adjust the width attribute as needed. There are various ways.

On the other hand you, if want continuous scrolling even though there isn't enough content to fill out your desired width, repeat all or some of the images you do have.