What is wrong with this line? I am getting the error "Object doesn't support this property or method"
thanksCode:document.getElementByID('propertyinvoiceDivHead').scrollLeft=document.getElementByID('propertyinvoiceDivBody').scrollLeft;
Michael
What is wrong with this line? I am getting the error "Object doesn't support this property or method"
thanksCode:document.getElementByID('propertyinvoiceDivHead').scrollLeft=document.getElementByID('propertyinvoiceDivBody').scrollLeft;
Michael
ok here is my working function but is it proper?
thxCode:function f_doScroll($1,$2){
oDivHead=document.all($2);
oDivBody=document.all($1);
oDivHead.scrollLeft=oDivBody.scrollLeft;
}
ms
document.all isn't in the standard DOM, it's an IE only feature. What exactly are you trying to do?
I think you should lower case the d in ID, that may be the cause.Quote:
Originally posted by msimmonsCode:document.getElementByID('propertyinvoiceDivHead').scrollLeft=document.getElementByID('propertyinvoiceDivBody').scrollLeft;
i didn't see that, well done. Yeah, it won't work unless it's getElementById
And I always do that too... (the ID rather than Id). What I am doing is I have tabular data that needs a 'sticky' header row so I am doing it w/two div's w/tables in them so if the data gets too wide and the botom (data) scrolls left to right then the top (headers) will scroll simutaniously.
Thanks guys (you two are the HTML/Javascript gurus :) )
Michael
I made that mistake when I first learnt about getElementById too, so I would spot it ;) And as you said earlier all should be getElementById in the other function too to be cross-browser.
Yeah, I'll be changing it back cos like I said in that other post (yesterday i think?) that I am trying to code to standards now.
ms
Girly voice: Oh stop that you, you're making me blush :o There are plenty of other people here that are great with HTML too, we're just sad enough to read all the posts ;)Quote:
Originally posted by msimmons
Thanks guys (you two are the HTML/Javascript gurus :) )
Michael
yeah, you two just seem to always be the ones to answer... I haven't seen CiberTHuG in a long time.