What's the best way to work with jquery plugins ? |
[eluser]chefnelone[/eluser]
Hello I use to work with jquery plugins. Usually I load them in my view page (let say index.php). I'm just wondering if is there a better way to load a jquery plugin. Let's say I use to work with just 1 of 2 menu plugins: menu1 and menu2. For them I have the folders: Menu1 and Menu2 and inside of each one the js and css files to make the plugin works. At the moment I choose one of them I insert the path in view/index.php: <link rel="stylesheet" href="<?php echo base_url();?>plugins/Menu1/menu1.css" /> [removed] [removed] or: <link rel="stylesheet" href="<?php echo base_url();?>plugins/Menu2/menu2.css" /> [removed] [removed] My question is: is there a better way to work with this kind of plugins. Maybe saving them in a folder and then loading then from a controller ? hope someone understand what I mean... Thanks
[eluser]CroNiX[/eluser]
Yes, there are asset managers which can do that for loading css/js/metadata into the head of the document at runtime based on the config file or what you tell it to directly from the controller. Very handy. Here is one: http://ellislab.com/forums/viewthread/101236/ There are more but I haven't personally used them.
[eluser]chefnelone[/eluser]
both of them looks really good, I think I will try Carabiner . thanks
[eluser]umefarooq[/eluser]
Carabiner is the best solution for these stuff, you can use css or js if it is required for some section. |
Welcome Guest, Not a member yet? Register Sign In |