Jquery effects with Codeigniter

Jquery effects with Codeigniter

Hai guys,

I'm completely new to JQ, and only have a little bit of experience with CI. What I want to accomplish is just to be able to add effects that are available via JQ and maybe later scriptaculous animations in my CI app.

So here is an example what I try to accomplish:

It's fairly simple, via CI an app is made, which consists out of a simple navigational menu. What I want to do is make make the content of a certain menu item to slide down when the menu <a href> is clicked.

TOP.php
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <head>
  4. <title>wadegast.com</title>
  5. <link rel="StyleSheet" href="/application/styles/styles.css" TYPE="text/css">
  6. <script src="http://code.jquery.com/jquery-latest.js"></script>
  7. <script type="text/javascript" >
  8. var jQ = jQuery.noConflict();
  9. jQ(document).ready(function (){
  10. jQ(".button").click(function (){
  11. alert("alert werkt, dus javascript o
  12. jQ("#kolom_links").slideToggle("slow");
  13. }); // end click function
  14. }); // end document.ready
  15.      </script>
  16. </head>
  17. <body>

get_webapp.php
  1. <?php
  2. $this->load->view('top'); // Load top
  3. $this->load->view('navigatie'); // Load navigatie
  4. ?>
  5. <div id="kolom_links" class="kolom_links">
  6. <? foreach ($q_getartikel->result() as $row){
  7. ?>
  8. <h1><? echo $row->show_name; ?></h1>
  9. <h5><? echo $row->description; ?></h5>
  10. <?
  11. } ?>
  12. </div>
  13. <?php
  14. $this->load->view('bottom'); // Load bottom
  15. ?>

The menu is loaded out of a table in my database. So the question is, how do I make this slideToggle() to work when the menu item is clicked???

Grtz,

Wes