111
rated 0 times
[
117]
[
6]
/ answers: 1 / hits: 16705
/ 11 Years ago, mon, january 27, 2014, 12:00:00
i want that the first tab should expand automatically mean when i refresh my page the first tab should expand like
General (top header)(-)
lorem ipsum (-)
lorem ipsum doller amu site amu doller
lorem ipsum (+)
lorem ipsum (+)
lorem ipsum (+)
lorem ipsum (+)
......please any one can help....
script is
$(document).ready(function() {
//Initialising Accordion
$(.accordion).tabs(.pane, {
tabs: '> h2',
effect: 'slide',
initialIndex: null
});
//The click to hide function
$(.accordion > h2).click(function() {
if ($(this).hasClass(current) && $(this).next().queue().length === 0) {
$(this).next().slideUp();
$(this).removeClass(current);
} else if (!$(this).hasClass(current) && $(this).next().queue().length === 0) {
$(this).next().slideDown();
$(this).addClass(current);
}
});
});
and html is
<div class=accordion>
<h2 style=background-color: #007194; text-align: center; padding: 0;font-family: 'Raleway',sans-serif;text-transform: uppercase;font-weight: normal;><span style=font-size: 40px;></span><?php echo $value;?> <span> FAQS </span></h2>
<div class=pane>
<div class=accordion>
<?php
while($row=mysqli_fetch_array($ret))
{
echo <h2> .$row['question'].</h2>;
echo <div class='pane'><div class='accordion'><p>.$row['answer'].</p></div></div>;
}
?>
</div>
</div>
</div>
More From » jquery