TidyTrax
08-30-2001, 07:01 AM
ive written a function that works fine on a test web page to change the style properties of certain elements, when i integrate it into my site im currently developing, it dont work - any ideas why???
CSS and JavascriptTidyTrax 08-30-2001, 07:01 AM ive written a function that works fine on a test web page to change the style properties of certain elements, when i integrate it into my site im currently developing, it dont work - any ideas why??? Ad1 08-30-2001, 07:15 AM not without seeing the code you are using TidyTrax 08-30-2001, 07:18 AM I have narrowed it down now, to the onload event in the body tag is not working, any ideas. If not i will put the code in my next post TidyTrax 08-30-2001, 07:53 AM Ok the problem also lies in that i cant access embedded tables here is the code im using function doSize() { myDocumentElements=document.getElementsByTagName("body"); myBody=myDocumentElements.item(0); myBodyElements=myBody.getElementsByTagName("table"); myHeader=myBodyElements.item(0); myHeader.style.width =screen.width; } This works fine accessing the first table in the document, but i cant access any embedded tables, any ideas or different code, i have tryed document.all[<id>].style.width = screen.width but that dont work either. As far as the onload in the body tag, i still dont know why that doesnt work Ad1 08-30-2001, 07:53 AM show me your code and I'll have a look, otherwise I can only take a wild guess Ad1 08-30-2001, 08:04 AM open a new project in VB add the webbrowser control and the HTML object library navigate the browser to your page and then in the browser's document_complete event put <pre> <font color=blue>Dim</font color=blue> doc <font color=blue>As</font color=blue> HTMLDocument <font color=blue>Set</font color=blue> doc = WebBrowser1.Document</pre> put a break point on the second line and drag <font color=red>doc</font color=red> into the watch window. you should now have a treeview of the DOM of your entire page, which will show you the path to get to your embedded tables Ad1 08-30-2001, 08:06 AM what is the code in the onload ? TidyTrax 08-30-2001, 08:13 AM I would do that if i could, but the VB on my machine is totalled and wont let me do that! Any further suggestions????? Ad1 08-30-2001, 08:19 AM if you use <pre>var myHeader = document.getElementById("name"); myHeader.style.width =screen.width; </pre>you should be able to get straight to the element you want, wether it's embedded or not TidyTrax 08-30-2001, 08:23 AM Thats it now, you've been a great help - cheers mate Matt |
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum