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
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <head>
- <title>wadegast.com</title>
- <link rel="StyleSheet" href="/application/styles/styles.css" TYPE="text/css">
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script type="text/javascript" >
- var jQ = jQuery.noConflict();
- jQ(document).ready(function (){
- jQ(".button").click(function (){
- alert("alert werkt, dus javascript o
- jQ("#kolom_links").slideToggle("slow");
- }); // end click function
- }); // end document.ready
- </script>
- </head>
- <body>
get_webapp.php
- <?php
- $this->load->view('top'); // Load top
- $this->load->view('navigatie'); // Load navigatie
- ?>
- <div id="kolom_links" class="kolom_links">
- <? foreach ($q_getartikel->result() as $row){
- ?>
- <h1><? echo $row->show_name; ?></h1>
- <h5><? echo $row->description; ?></h5>
- <?
- } ?>
- </div>
- <?php
- $this->load->view('bottom'); // Load bottom
- ?>
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