PDA

View Full Version : CMotion - Scrolling image to original position causes 'over-scroll'



matm00
11-20-2006, 02:09 PM
1) Script Title: CMotion Gallery

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm

3) Describe problem: Scrolling the images back to their original position causes 'over-scroll' sometimes

I have set up the script to place the left side of the first image on the left side of the browser window so the images scroll from left to right as we would normally read a page. Everything works fine, but sometimes when scrolling back to the first image it over-scrolls by 10px or so leaving a gap on the left of the first image. I've removed all borders and padding etc so there shouldn't be any gaps between images and there are no margins on the body of the page, so the image should stop right at the edge of the page.

jscheuer1
11-21-2006, 06:14 PM
Well, I see that you've received a suggestion from ddadmin already on this script in a different regard. I would have given different advice for the nobr validation problem. First, there is almost no reason to use XHTML. Second, if a tag doesn't validate, it doesn't always mean that it is 'bad'. Third, if you must have the validation, using a div tag in place of a nobr tag isn't strictly correct, it should be a span tag, with the same styling that ddadmin mentioned. That's because a nobr is an inline element, like a span, not a block level element, like a div.

I'd first try using the nobr tag again and see if this fixes it. Using a block level element in place of an inline one can cause a line break that, under these type of conditions may cause a gap.

It might be something else, particularly if you've changed some of the other style in the script's markup, or something to do with other markup containing the script on your page.

To be more specific, I would need a link to your page.

matm00
11-22-2006, 12:52 PM
Thanks for the reply John. Unfortunately I'm one of those sad perfectionists who has to have everything 'just so'. However, point taken about non-validating tags not necessarily being 'bad'. I'd be interested in your views on why using XHTML isn't necessary. Surely everyone working to a common standard is a good thing, isn't it? Anyway, the answer to that question is probably way beyond the scope of this thread...

I've changed the nobr tag to a span tag and it works fine, so I'm happy. Thanks :)

jscheuer1
11-22-2006, 06:10 PM
Standards are good. HTML 4.01 strict is the highest standard currently available for the type of page you are creating. XHTML isn't even supported by the vast majority of the installed base of browsers and is only needed if you are serving xml program applications (not for feeds using xml or other sorts of utilitarian xml usages). Those browsers which do not support XHTML will revert to quirks mode, the lowest 'standard' available and in fact, no standard at all, as will most browsers that support XHTML, if you have one error in coding.