Hi
Can anyone help with this….
I’m trying to create a flip box that has text on either side. One side will be correct and one side will be incorrect.
I need to work out…
[LIST][*]
How to write different text on the other side of each flip box.
How to differentiate between when the box is flipped and when it isnt (to assign a value)
How to disable boxes when all are correct or how to add a subit button so that when users think the boxes are correct they click to check answers
So far I have this and now im stuck, its not doing exactly what i want. I’m new to all this and just need a bit of guidance…
[CODE]<style>
.content {
width: 880px;
height:180px;
}
.test {
width:800
height:100
}
.answers{
position:absolute;
width:25px;
height:20px;
left: 200px;
top: 4px;
}
.correct{
background-repeat:no-repeat;
background-image:url(assets/correct-small.png);
z-index:1;
}
.incorrect{
background-repeat:no-repeat;
background-image:url(assets/incorrect-small.png);
z-index:1;
}
.flip {
position:relative;
float:left;
margin-left:3px;
margin-right:3px;
width: 500px;
height: 22px;
padding: 3px;
margin-bottom: 2px;
border: 1px #CCC solid;
background-color: #EFEFEF;
text-align: center;
}
.flip:hover{
cursor: pointer;
background-color: #FFF;
}
</style>
<script language=”javascript”>
trueCount = 0;
falseCount = 0;
for(i=1;i<=15;i++) {
$(“#flipbox” + i).click(function(){
$(this).flip({
direction:’tb’,
color: ‘#EFEFEF’,
});
});
}
function addAnswer(div, answer){
if($(“#”+div).hasClass(“correct”)) {
trueCount–;
$(“#”+div).removeClass(“correct”);
}
else {
$(“#”+div).addClass(“correct”);
answersArray[trueCount] = $(“#”+div).parent().html().substr(0, $(“#”+div).parent().html().indexOf(‘<‘));
trueCount++;
if(trueCount == 2) {
$(“.test”).fadeOut(1000, function(){
$(this).html(“<h3>Correct – </h3>”
).fadeIn(1000);
})
}
}
}
updateBookmark();
</script>
<br /><br />
<div class=”content”>
<div class=”flip” onclick=”addAnswer(‘answer1′,’c’)” id=”flipbox1″>Reading a book<div class=”answers” id=”answer1″></div></div>
<div class=”flip” onclick=”addAnswer(‘answer2′,’t’)” id=”flipbox2″>Position their body so that they are facing you <div class=”answers” id=”answer2″></div></div>
<div class=”flip” onclick=”addAnswer(‘answer3′,’c’)” id=”flipbox3″>Talk<div class=”answers” id=”answer3″></div></div>
<div class=”flip” onclick=”addAnswer(‘answer4′,’t’)” id=”flipbox4″>Make eye contact<div class=”answers” id=”answer4″></div></div>
<div class=”flip” onclick=”addAnswer(‘answer5′,’c’)” id=”flipbox5″>Ask questions<div class=”answers” id=”answer5″></div></div>
</div>
<div class=”test”></div>