$("#id_btnquizzestwo").click(function() {
$temp = $("#rightsideeightone").is(":visible");
if($temp) {
$("#rightsideeightone").css('display') = 'none';
}
})
The rightsideeightone division is not being hidden.
What to do ?
$("#id_btnquizzestwo").click(function() {
$temp = $("#rightsideeightone").is(":visible");
//alert($temp);
if($temp) {
$("#rightsideeightone").hide();
}
$temp2 = $("#rightsideeighttwo").is(":hidden");
//alert($temp2);
if($temp2) {
$("#rightsideeighttwo").show();
}
})
I tried this, the rightsideeighttwo is not being visible. Initialy the rightsideeightone is visible and the rightsideeighttwo is hidden.
<div id="rightsideeight" >
<div id="id_pollsquizzes" >
<?php echo '<ul>'; ?>
<?php
echo '<li>';
echo $this->Form->button('Polls',array('type'=>'button','id'=>'id_btnpollstwo'));
echo '</li>';
echo '  ';
echo '<li>';
echo $this->Form->button('Quizzes',array('type'=>'button','id'=>'id_btnquizzestwo'));
echo '</li>';
echo '  ';
?>
</div>
<div id="rightsideeightone" style="visibility: visible" >
......................
</div>
<div id="rightsideeighttwo" style="visibility: hidden" >
......................
</div>
</div>
The line
is incorrect. To change a style property, use this syntax:
Checking the visibility isn’t necessary – if the element $(“#rightsideeightone”) is already hidden then hiding it again has no effect, so your function can be written as: