Jump to content

how to put the rest of the record inside a toggle div?


geekisthenewsexy

Recommended Posts

hi guys. okay first off, i don't know exactly if this is more on php or javascript. but if you think it's more on php then you can move this :D

okay, so here goes.

in my main page (index.php), i've included the file for the record (records.php)

which means that the records are already shown.

 

and along with the main page is this script:

<script type="text/javascript">
animatedcollapse.addDiv('view', 'fade=1')
animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted
//$: Access to jQuery
//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID
//state: "block" or "none", depending on state
}
animatedcollapse.init()
</script>
<div><a href="javascript:animatedcollapse.toggle('view')">View records </a> 
       	  <a href="javascript:animatedcollapse.toggle('view')"><img src="images/toggle.png" alt="toggle" /> </a></div>
        <div id="view" class="faq-ans">The rest of the record goes here...
	</div>

 

okay, my problem now is how to show only half of the records from the database so that the page won't get too crowded.

and if i click "View records" the rest of the records should show up..kinda like toggled "view more.." in some sites..

i was thinking of posting some of the php code here but i think that would break the rules as this after all javascript section.

anyway i hope you guys can me help on this.. :confused:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.