JimWorld Forums: DHTML panel switch



Posted By: Curt ()
Posted On: 01/13/2008 02:20 am

For simplification's sake, I will post the rudimentary outline of what I'm trying to do. Here's the code:


Code: [copy]




The above code works fine in Firefox, but does NOT operate correctly in MSIE7. When the second link is clicked, the whole button scheme disappears making the page useless.

Hopefully I've kept this simple enough for the other code masters to easily identify the flaw or to identify where something is missing. I'm just not seeing why it's not working. Insights anyone?


Posted By: Curt ()
Posted On: 01/13/2008 10:06 pm

Here's the code again displayed in full view:

————————————————————————————————————
<html>
<head></head>
<body>

<div id="FirstToSecond">
<table cellpadding="4" cellspacing="5" border="0"><tr>
<td bgcolor="#aaaaaa"><a href="#" onClick="SwitchTable();return true" class="SwitchTxt">First to Second</a></td>
<td bgcolor="#ffcccc"><a href="#" onClick="SwitchTable2();return true" class="SwitchTxt">Second to First</a></td>
</tr></table>
</div>

<div id="SecondToFirst">
<table cellpadding="4" cellspacing="5" border="0"><tr>
<td bgcolor="#ffcccc"><a href="#" onClick="SwitchTable();return true" class="SwitchTxt">First to Second</a></td>
<td bgcolor="#aaaaaa"><a href="#" onClick="SwitchTable2();return true" class="SwitchTxt">Second to First</a></td>
</tr></table>
</div>

<script type="text/JavaScript"><!--

box = document.getElementById("SecondToFirst" ); box.style.visibility = "hidden"; box.style.position = "absolute"

function SwitchTable() {
box = document.getElementById("FirstToSecond" ); box.style.visibility = "visible"; box.style.position = "relative"
box = document.getElementById("SecondToFirst" ); box.style.visibility = "hidden"; box.style.position = "absolute"
}

function SwitchTable2() {
box = document.getElementById("SecondToFirst" ); box.style.visibility = "visible"; box.style.position = "relative"
box = document.getElementById("FirstToSecond" ); box.style.visibility = "hidden"; box.style.position = "absolute"
}

// --></script>


</body></html>
————————————————————————————————————

Hopefully that makes it a little bit more plain and won't scare away all you techies.


Posted By: beth_lk (Insider)
Posted On: 01/13/2008 11:46 pm

All your T's are crossed and I's are dotted ( as the old saying goes ) from what I can see - hope someone here can help you smile




Posted By: g1smd (Moderator)
Posted On: 01/14/2008 04:51 pm

I do almost zero javaScript stuff... so I have no idea what that is all about. Sorry!


Posted By: Curt ()
Posted On: 01/14/2008 06:59 pm

Yep, it should work, but does not for MSIE. I hate MSIE. I've run into this crap over and over repeatedly with ole bill gates' microcrap. Works well with firefox, but not in MSIE.

In fact, nearly all my Javascripting, DHTML and CSS problems originate with Microcrap Internet Destroyer. MCID stinks.

MCID = MSIE


Posted By: g1smd (Moderator)
Posted On: 01/15/2008 11:56 am

Have you run JSLint or whatever it is called over the JS files to see incompatibilities and problems listed?

I have seen it but never used it.


Posted By: Curt ()
Posted On: 01/17/2008 04:34 pm

[old statement no longer relevant]


Posted By: Curt ()
Posted On: 01/17/2008 04:43 pm

OK, I found the web site (www.jslint.com). However, the errors I'm seeing don't make sense to me. The code is simple (in the above example) and should run without a hitch. Perhaps I'm missing something that needs to be added. At my wits end.

Dang, really hate microcrap.


Posted By: Curt ()
Posted On: 01/24/2008 04:25 pm

Where are the JavaScript supermen when you need them? smile


JimWorld Forums © 1996 - 2004 .... iWeb Technology, Jimworld.com