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:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.