Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Lightbox gallery - prototype.js and jQuery conflict View modes: 
User avatar
Member
Member
damian-brandcape.co - 11/24/2010 3:45:13 PM
   
Lightbox gallery - prototype.js and jQuery conflict
If you use jQuery on the same page as a Kentico lightbox, you get the "$" conflict that is easily solved by using jQuery.noConflict(). However a weird bug with a negative index array then pops up from prototype.js (which is used by the lightbox).

This is solved by upgrading to the latest version of prototype.js - but this is THREE times the size of the old version (166kb) This comes down to 120kb by minifying - but it's still pretty thick given the ammount of JS on the page in the first place.

If anyone has any better solutions - I'd be most grateful.

Damian

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 11/26/2010 1:53:51 AM
   
RE:Lightbox gallery - prototype.js and jQuery conflict
Hi,

Well, if you need to use jQuery on your page, you can use following code which will register Kentico CMS jQuery script on your page:

CMS.GlobalHelper.ScriptHelper.RegisterJQuery(Page)

public static void RegisterJQuery(
Page page
)


Then you can access your elements with following example code:

$j('.xxx') or jQuery('.xxx')

Best regards,
Miroslav Remias.

User avatar
Member
Member
nirmalh-mindfiresolutions - 11/27/2010 12:15:48 AM
   
RE:Lightbox gallery - prototype.js and jQuery conflict
where to use this code snipette ?
owuld you please tell the exact location where the code should be placed to work jQuery properly.

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 11/29/2010 8:05:14 AM
   
RE:Lightbox gallery - prototype.js and jQuery conflict
Hi,

You can call the example code from some web part code file or if you are using ASPX page templates, then you can call the code from code file of your ASPX page template.

Best regards,
Miroslav Remias.