Debt Consolidation - Find jobs - Cheap Plane Tickets - Manga - Wordpress Themes

PDA

View Full Version : Accordion loading problem


sami1255
Apr 22nd 2009, 9:44 am
well i dont know java scripting at all... heres a problem iam facing.

1) I got myself look moron to use table inside accordion item :D

2) Everything is perfect except accordion items show all content and then hide em, on bodyload.

3) what i want is that onbodyload, the accordion loads the content without showing them.

here is a bit of code to help you out..

<body onload="new Accordian('accordian',9,'header_highlight');">

menu displays..

<div id="accordian" ><!--Parent of the Accordion-->

<?php $i = 1; if (have_posts()) : while (have_posts()) : the_post(); ?>

<!--Start of each accordion item-->
<div id="test<?php if ($i != 1) { echo $i-1; } ?>-header" class="accordion_headings<?php if ($i == 5) { ?> header_highlight<?php } ?>" ><?php the_title(); ?></div><!--Heading of the accordion ( clicked to show n hide ) -->

<!--Prefix of heading (the DIV above this) and content (the DIV below this) to be same... eg. foo-header & foo-content-->

<div id="test<?php if ($i != 1) { echo $i-1; } ?>-content"><!--DIV which show/hide on click of header-->

<!--This DIV is for inline styling like padding...-->
<div class="accordion_child">
<?php the_content(''); ?>
</div>
</div>
<!--End of each accordion item-->

<?php $i++; endwhile; ?>

Any free help will be really appreciated other wise if you wanna get some bucks outa it.. follow up with this thread (http://forums.digitalpoint.com/showthread.php?t=1317411)and lets see if we can have a deal

JavaScriptBank.com
Apr 22nd 2009, 11:13 pm
in your code above, you use onLoad event directly, maybe cause of this; you should use the smarter onload script (http://www.javascriptbank.com/javascript/snippet/multiple-functions-onload/detail/); you can use one of them from my JavaScript library (http://www.javascriptbank.com), as: Multiple Functions onLoad (http://www.javascriptbank.com/javascript/snippet/multiple-functions-onload/detail/)


if still there's error, please let me know

sami1255
Apr 23rd 2009, 9:33 am
its more like promoting your site rather than help ;)