Jocka Posted August 18, 2006 Share Posted August 18, 2006 all I want this to do is "slowly" expand this tables width. I've tried just about everything i could think/find. I searched many tutorials on google but none of them actually "expand' the table, they just hide it.I tried using this code, and to ME it looks like it should work.. but it doesn't..(ITS NOT LETTING ME POST MY JAVASCRIPT CODE SO IM THROWING SOME B/S STUFF IN THERE TO 'HIDE' IT)[code]<html><head><--script type="text/-javascript">function expand(tblid) {if (tbl = document.getElementById(tblid)) {var i=0for (i=0;i<=10;i++){tbl.width=i}}}</--script></head><body onload="expand('test')"><table border="1"><tr><td id="test" name="test">TEST</td></tr></table></body></html>[/code]What am I doing wrong here? Quote Link to comment Share on other sites More sharing options...
radalin Posted August 18, 2006 Share Posted August 18, 2006 Well probably the thing is that computer is finishing that loop so quick that you do not see if it expands or not. You should add some delay options there and your code should work then. Quote Link to comment Share on other sites More sharing options...
Jocka Posted August 18, 2006 Author Share Posted August 18, 2006 delays might work.. but it's not expanding at all.. the width just stays large enough for the text, never gets bigger. Quote Link to comment Share on other sites More sharing options...
radalin Posted August 19, 2006 Share Posted August 19, 2006 Yeah that was quite intresting. I tried what I said to you. And the thing is delay do not work. Perhaps that I missed something but browser does not redraw the table till the end function (at the end it's expanded by the way but I do not see that expand effect). And delays was nearly crushing my browser :) Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 19, 2006 Share Posted August 19, 2006 [quote author=Jocka link=topic=104692.msg417743#msg417743 date=1155860426](ITS NOT LETTING ME POST MY JAVASCRIPT CODE SO IM THROWING SOME B/S STUFF IN THERE TO 'HIDE' IT)[/quote]It's because of their Intrusion Prevention System (IPS). More info here: http://www.phpfreaks.com/forums/index.php/topic,104265.0.html Quote Link to comment Share on other sites More sharing options...
Jocka Posted August 19, 2006 Author Share Posted August 19, 2006 Yea, I don't get why it's not expanding. It either just sets there or shoots to the max width... i'm lost on this lol. all i wanted to do is make like a little "load" looking thing. Quote Link to comment Share on other sites More sharing options...
Jocka Posted August 22, 2006 Author Share Posted August 22, 2006 *bump* Quote Link to comment Share on other sites More sharing options...
syed Posted August 23, 2006 Share Posted August 23, 2006 Hi guys I had a go at it. I have it working, needs a bit of work. I have tried many times to post the code, but i get a page not found or something and when i did post it, the javascript was missing, if u want it mail me and i will mail you the code, or just come visit me at my site and i will post it for u. Sorry guys, i did try my best to post it here. my site is www.cy2online.net Quote Link to comment Share on other sites More sharing options...
Jocka Posted August 24, 2006 Author Share Posted August 24, 2006 [quote author=syed link=topic=104692.msg420474#msg420474 date=1156312097]Hi guys I had a go at it. I have it working, needs a bit of work. I have tried many times to post the code, but i get a page not found or something and when i did post it, the javascript was missing, if u want it mail me and i will mail you the code, or just come visit me at my site and i will post it for u. Sorry guys, i did try my best to post it here. my site is www.cy2online.net[/quote]You can post it here, but you have to edit the javascript like I did. put dashes in it like this:[code]<--script type="text/-javascript">// code</---script>[/code] Quote Link to comment Share on other sites More sharing options...
syed Posted August 26, 2006 Share Posted August 26, 2006 This is the code.<style>td.td1 { font-family:tahoma; }</style><script language=javascript>var counter=0;function expand(){counter = counter +10; if (counter <= 100){ Id = window.setTimeout("expand()",15); }document.getElementById("td1").innerHTML = "<table border=1><tr><td valign=top height='" + counter + "'>Test</td></tr></table>";}</script><a href="#" onclick="expand()">Expand</a><table><tr><td id="td1" class="td1"></td></tr></table> Quote Link to comment Share on other sites More sharing options...
syed Posted August 26, 2006 Share Posted August 26, 2006 This forum is so messed up. You need to replace where it says Expand [/url] it should be Expand </ a>. remove the space. Let me know if you get it to work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.