View Full Version : Resolved "minus" image not appearing on onclick menu toggle

06-22-2009, 04:16 PM
I'm completely new to js and am adapting some code that will display answers to FAQs upon clicking on a + (icon_add.gif). A - (icon_remove.gif) is supposed to appear when the answer is displayed, but I can't get this to happen.

Seems like it must be something fairly minor, but can't figure it out. Would appreciate anyone taking a quick look at my code. (please ignore the gaudy colors, etc.; I'm just trying to get a feel for what tags in the css change what in the html page)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>trying to get this menu thingy to work</title>

<script type="text/JavaScript">

function toggleRowVisibility(row_id) {
var rowObj = document.getElementById("ans_"+row_id);
var imgObj = document.getElementById("img_"+row_id);

if (rowObj) {
if (rowObj.style.display=='none') {
rowObj.style.display = ''
imgObj.src = "icon_remove.gif";
} else {
rowObj.style.display = 'none'
imgObj.src = "icon_add.gif";


<link href="togglemenu.css" rel="stylesheet" type="text/css" />
<style type="text/css">


<script type="text/JavaScript">
function MM_openBrWindow(theURL,winName,features) { //v2.0


<div class="main-text">
<h4> Frequently Asked Questions about Teaching Online </h4>
<p> When you're new to teaching online, it can seem overwhelming. Here are some answers to common questions that you might have.</p>

<img src='icon_add.gif' width=13 height=13 border=0 onclick='toggleRowVisibility(0);' id='img_0'></span><span class="faq_title">Which LMS is right for me?</span><br>

<div id='ans_0' style='display:none' class='faq_answer'><p><span class="highlight"><a name="whichlms" id="whichlms"></a>Choosing an LMS</span>: At CPCC, the majority of
online instructors use the Blackboard lms, partly because it has been available for the longest time. However, Moodle is a very reputable lms with a very different look and
feel that some online instructors prefer. If you do not lean toward one lms or another, perhaps the better option is to evaluate both of them before you make your final decision.
Although it's possible to switch from one lms to the other, it's time consuming. So it's far better to take some time right now to make your choice. </p>
<p><span class="highlight">Moodle users</span>: In some respects, Moodle is more accommodating to the use of html, which can be fun.</p></div>

<img src='icon_add.gif' width=13 height=13 border=0 onclick='toggleRowVisibility(1);' id='img_1'></span><span class="faq_title">How much training in my LMS do I need before I begin developing my online class? </span><br>

<div id='ans_1' style='display:none' class='faq_answer'>It depends on your relative comfort level with computers, the Internet, and your LMS. You certainly need at least introductory training in your LMS, so that you understand what tools are available and generally how everything works. Then you will be able to concentrate on the pedagogy of teaching online.



06-22-2009, 07:23 PM
Not sure why, all of a sudden. Must have been some kind of refresh...I didn't change anything. Sorry for the false alarm...