Forum Moderators: open
I can get one to work OK, but if I try and get more than on on a page it only activates the last one ...
(code stript down to basics for help)
I have tried all sorts of methods....
such as
onclick="showIt('humor')"
onclick="showIt(humor)"
etc
but never can I get both working at once.
this works...
<script src="../ajax/lib/prototype.js" type="text/javascript"></script>
<script src="../ajax/src/scriptaculous.js" type="text/javascript"></script>
<body>
<SCRIPT type="text/javascript">
function showIt(humor) {new Effect.Appear('humor');}
function hideIt(humor) {new Effect.Fade('humor');}
function showIt(general) {new Effect.Appear('general');}
function hideIt(general) {new Effect.Fade('general');}
</SCRIPT>
<h2 onclick="showIt('general')">General topics - click for more</h2>
<DIV id="general" style="display:none">
<h2 onclick="hideIt('general')">Click to close </h2>
test
</div>
<h2 onclick="showIt('humor')">Humor - click for more</h2>
<DIV id="humor" style="display:none">
<h2 class="index_heading1" onclick="hideIt('humor')">Click to close </h2>
test1
</div>
</body>
It really depends on your code and as the majority of your AJAX code is hidden it will be hard for anyone to solve your issue.
I do have one application that has 6 or 7 AJAX objects running concurrently. So it really shouldn't be an issue.