homer.favenir 0 Posted October 31, 2008 Share Posted October 31, 2008 hi, i have a javascript menu bar it has 1 folder (lib folder) and five files (menu.php - this is the index, demo.css, demo.js, mootools.js, .project). it is working on standalone. my question is how and where can i save this files in code igniter to work. i copy/paste it in the view and change the controller function index() to $this->load->view('menu',$data). but the effects didnt work, it should slide down, but what it did is just a link my menu.php script is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="demo.css" type="text/css" /> [removed][removed] [removed][removed] <title>MouseEnter Demo</title> </head> <body> <div id="myElement"> </div> <div id="myOtherElement"> <span><strong>Menu</strong></span> <div> <a href="#">Client 1</a> <a href="#">Client 2</a> <a href="#">Client 3</a> </div> </div> </body> </html> Link to post Share on other sites
wildteen88 3 Posted October 31, 2008 Share Posted October 31, 2008 You should place all your static files (css, js, images etc) where your index.php file is. Link to post Share on other sites
Liquid Fire 0 Posted November 1, 2008 Share Posted November 1, 2008 You should place all your static files (css, js, images etc) where your index.php file is. That is a pretty ugly structure to have your index.php, css, images, and js is the same folder without be able to break it up. Link to post Share on other sites
wildteen88 3 Posted November 1, 2008 Share Posted November 1, 2008 You can place your images etc within separate folders too if you wish. The folders must be in the same directory as your index.php file though. You should not be putting any static content anywhere in your application folder. I tend to setup my CI directory structure like so My CodeIgnitor App | +-- System/ | +-- Application/ | +-- static/ | | | +-- images/ | | | +-- js/ | | | +- style.css +- index.php When loading say style.css within my views for example I'd use <link rel="stylesheet" type="text/css" href="<?php echo base_url().'static/style.css'; ?>" /> Link to post Share on other sites
Liquid Fire 0 Posted November 1, 2008 Share Posted November 1, 2008 You can place your images etc within separate folders too if you wish. The folders must be in the same directory as your index.php file though. You should not be putting any static content anywhere in your application folder. I tend to setup my CI directory structure like so My CodeIgnitor App | +-- System/ | +-- Application/ | +-- static/ | | | +-- images/ | | | +-- js/ | | | +- style.css +- index.php When loading say style.css within my views for example I'd use <link rel="stylesheet" type="text/css" href="<?php echo base_url().'static/style.css'; ?>" /> Ah... I thought tou mean something like My CodeIgnitor App | +-- System/ | +-- Application/ | +- jquery.js +- site.css +-etc... +- index.php Link to post Share on other sites
wildteen88 3 Posted November 1, 2008 Share Posted November 1, 2008 Nope Link to post Share on other sites
homer.favenir 0 Posted November 4, 2008 Author Share Posted November 4, 2008 i got it! i copy/paste the javascript directory after the base url. C:\xampp\htdocs\DSValidator\javascript and change my script to <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="<?php echo base_url(); ?>javascript/demo.css" type="text/css" /> [removed][removed] [removed][removed] <title>MouseEnter Demo</title> </head> <body> <div id="myElement"> </div> <div id="myOtherElement"> <span><strong>Menu</strong></span> <div> <a href="#">Client 1</a> <a href="#">Client 2</a> <a href="#">Client 3</a> </div> </div> </body> </html> maybe this will help to anyone who have the same issue. im sorry but i didnt made the [remove][/remove] tag. its in the forum thanks for all the help guys. Link to post Share on other sites
Recommended Posts
Archived
This topic is now archived and is closed to further replies.