Tuesday, November 17, 2009

Jquery conflict removes in joomla

Sometimes you may need to use two or more libraries in your site. Sometimes you may nee to use mootool and your custom jquery code in your site. There may be arise a conflict between two library. Here we can use some way to remove Jquery conflict. Using jQuery with Other Libraries.
Suppose in your joomla site you add a custom module using jquery for image slide show. And use another module which is also using other library. Here is the way:

If you want to make sure that jQuery won't conflict with another library - but you want the benefit of a short name, you could do something like this:


<html>
<head>



</head>
<body></body>
</html>

This technique is works for me. also i found other way to remove the conflict. those are below:
[Overriding the $-function]

you can override that default by calling jQuery.noConflict() at any point after jQuery and the other library have both loaded. For example:

<html>
<head>



</head>
<body></body>
</html>

Finally, if you don't want to define another alternative to the jQuery name (you really like to use $ and don't care about using another library's $ method), then there's still another solution for you. This is most frequently used in the case where you still want the benefits of really short jQuery code, but don't want to cause conflicts with other libraries.

<html>
<head>



</head>
<body></body>
</html>


This is probably the ideal solution for most of your code, considering that there'll be less code that you'll have to change, in order to achieve complete compatibility.

hope it will help you :)

3 comments:

  1. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
    html5 player| html5 video player

    ReplyDelete
  2. Hi guys, I really enjoyed your blog it was quite inspirational, keep posting! http://www.lowhosting.com/bluehost-review/

    ReplyDelete