i have two product categories which customer can preview when click,
and wish to show a message on each item. Ive found a nice script but
need help to make this in 2 sets. need help. Happy new year!
<!DOCTYPE html>
<html lang="en">
<title>Untitled Document</title>
<script type="text/javascript">
var current = null;
function showresponddiv(messagedivid){
var id = messagedivid.replace("message-", "respond-"),
div = document.getElementById(id);
// hide previous one
if(current && current != div) {
current.style.display = 'none';
}
if (div.style.display=="none"){
div.style.display="inline";
current = div;
}
else {
div.style.display="none";
}
}
</script>
<style type="text/css">
.box li { cursor:pointer; }
#banks .active { color:red; }
#buttons .active { color:blue; }
</style>
</head>
<body>
<div id="message-1" onclick="showresponddiv(this.id)">Set1 a
</div>
<div id="respond-1" style="display:none;">Bar1
</div>
<div id="message-2" onclick="showresponddiv(this.id)">Set1 b
</div>
<div id="respond-2" style="display:none;">Bar2
</div>
<div id="message-3" onclick="showresponddiv(this.id)">Set1 c
</div>
<div id="respond-3" style="display:none;">Bar3
</div>
</body>
</script>
</html>