|
#1
|
|||
|
|||
|
CMotion Image Gallery
http://www.dynamicdrive.com/dynamici...iongallery.htm I have put the script into my page to display ten images. When viewed through IE, the script works fine, but FireFox only wants to show seven and a bit of the images before declaring End Of Gallery. I have looked through the code but can't find any limiter of the 'length' of the slideshow (presumably IF there were one it would be in pixels, as the 'last' image diplayed in FF is only partly visible). Any idea what the issue might be in FireFox? I haven't checked the page on other browsers yet... Many Thanks. A. |
|
#2
|
||||
|
||||
|
I've run across this a few times before and was searching the archives to see if I could find the solution. I only found one relevant thread but, there, no solution was found. I distinctly remember finding one though, for another fellow. It was a tough case, one where we found a few partial solutions that had drawbacks and I needed to go over the source numerous times. Finally we came up with a workable solution. If you could supply a link to the page in question, I'll give it a crack.
__________________
WWWWWWWWWWWW - John________________________ Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate |
|
#3
|
||||
|
||||
|
Turn's out the old adage - you learn more from your failures than you do from your successes - is true in this case. I decided to go after this problem using the case I found in the archives that I hadn't been able to solve, as it turns out, a much simpler example. By simply removing the doctype declaration, I was able to fix it. The trouble is that with a doctype of:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> Code:
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("temp").offsetWidth
Code:
actualwidth=document.all? cross_scroll.offsetWidth : number Code:
actualwidth=document.all? cross_scroll.offsetWidth : 1850 Code:
alert(actualwidth)
__________________
WWWWWWWWWWWW - John________________________ Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate Last edited by jscheuer1; 06-26-2005 at 04:05 AM. Reason: spelling |
|
#4
|
||||
|
||||
|
I looked into this further and the real fix is to give the <nobr> tag on the display page an id like so:
HTML Code:
<div id="motioncontainer" style="position:relative;width:400px;height:150px;overflow:hidden;"> <div id="motiongallery" style="position:absolute;left:0;top:0;white-space: nowrap;"> <nobr id="trueContainer"><a href . . . snip! Code:
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("temp").offsetWidth
Code:
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("trueContainer").offsetWidth
__________________
WWWWWWWWWWWW - John________________________ Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate |
|
#5
|
|||
|
|||
|
A simple and elegant solution.
Many thanks for the time you invested in the problem, John. It's much appreciated. *runs off to download some more browsers ![]() A. |
|
#6
|
|||
|
|||
|
I downloaded this fantastic script and implemented it on a testpage.
In IE there are no problems, in Firefox (1.0.5) and Netscape (7.2) i'm receiving the following error : Quote:
Allthough most of the users are using IE, I would like it to work in all browsers. I must admit i'm not an expert in javascript, so if anyone can help ??? |
|
#7
|
||||
|
||||
|
Two things at work here and I have some suggestions for refinement. First of all, you broke the 'fix' for this script when you introduced another 'containing element', a table, into the html markup. If you remove id="trueContainer" from the <nobr> tag and apply it to the <table> tag, this will correct that:
HTML Code:
<nobr> <table id="trueContainer"> Code:
var maxspeed=7 //2) top scroll speed in pixels. Script auto creates a range from 0 to top speed. Code:
var maxspeed=(document.all&&!window.opera)? 7 : 27 //2) top scroll speed in pixels. Script auto creates a range from 0 to top speed. The other suggestion that I have is that if you want the galley centered, enclose the entire html part in a centered element.
__________________
WWWWWWWWWWWW - John________________________ Really Show Your Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate |
|
#8
|
|||
|
|||
|
Thank you very much. It's working now in the other browsers too.
|
|
#9
|
|||
|
|||
|
Hello,
I use the CMotion Gallery and I also came accross the "b has no properties" Javascript error, but I don't get this error in the same situation than "Soldierflup". It happens on FireFox (1.0.6), Netscape (7.2 & 8.0), when I use the mouse scroll button (to scroll up or down the page), while being over the gallery with the mouse cursor. That a really particular case I admit, but maybe someone will be more successful to debug this, I tired but I couldn't find any solution to this :S My guess is that Firefox/Netscape (well Gecko) considers that the mouse moves out of the gallery (although it doesn't in my case, the scrollbar is very small) ... which call the "stopmotion" function. This error doesn't happen in Opera... Thanks a lot for your script, and thanks in advance for your answers. |
|
#10
|
|||
|
|||
|
I guess I'll answer my stupid question myself... mabye I'll help other people like me
![]() Replace : Code:
function contains_ns6(a, b) {
if(b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
}
return false;
}
Code:
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
Hope it will help, sorry again
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|