Welcome Guest, Not a member yet? Register   Sign In
What's the best way to work with jquery plugins ?


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]


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

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:

There are more but I haven't personally used them.

Personal favourite is:

both of them looks really good, I think I will try Carabiner .

It was my problem too.

Thank u Smile

Carabiner is the best solution for these stuff, you can use css or js if it is required for some section.

Theme © iAndrew 2016 - Forum software by © MyBB