Forums

angle-left Back

RE: enlarge images onclick

BL
Benjamin Linder, modified 9 Years ago.

enlarge images onclick

New Member Posts: 7 Join Date: 3/5/09 Recent Posts
Hi everyone...
I'm searching for a way to enlarge my images onclick. I know i can add a link to an image that opens a bigger one in a new window but i want to show the new one in the same window.
I need something like lightbox that works with liferay's image library. And adding images to a web content should be user friendly ... mb I can use templates for this.

Is there already a way to enlarge images in liferay ??

thanks for help ...
IB
istvan benedek, modified 8 Years ago.

RE: enlarge images onclick

New Member Posts: 10 Join Date: 8/21/09 Recent Posts
Hey Benjamin,

I have the same issue, I am about to find a 3rd party image gallery which is already integrated with Liferay...

In the mean time , did you figure out something? Or could you give a hint ? (flash or js)

Istvan
Lisa Simpson, modified 8 Years ago.

RE: enlarge images onclick

Liferay Legend Posts: 2034 Join Date: 3/5/09 Recent Posts
Depending on what you're doing, you can put that javascript on your page.
IB
istvan benedek, modified 8 Years ago.

RE: enlarge images onclick

New Member Posts: 10 Join Date: 8/21/09 Recent Posts
Sure.. just you know, I'm a lazy guy.. So, if somebody would offer an existing solution...
JT
Jan Tošovský, modified 7 Years ago.

RE: enlarge images onclick

Expert Posts: 451 Join Date: 7/22/10 Recent Posts
I have quite narrow column for my content and I plan set the overflow property to auto to all the images (they can be scrolled if they are wider). They would be clickable so user could display them complete without scrolling if necessary.
I plan to put that javascript into every liferay page.
But I'd like to ask.
1) isn't there already some javascript method available for this to be used directly in my html code (i.e. calling known function on mouse click)
2) if not, do you have any experience with any library for this (lightbox-like) which is harmfull to the rest of javascript code?

Jan
JT
Jan Tošovský, modified 7 Years ago.

RE: enlarge images onclick

Expert Posts: 451 Join Date: 7/22/10 Recent Posts
I've found answer partially in this blog http://www.liferay.com/web/nathan.cavanaugh/blog/-/blogs/using-jquery-or-any-javascript-library-in-liferay-6-0
In my case I can link necessary libraries in my custom portlet.
And if a lightbox clone for YUI is used, it is sufficient to link just 7kB JavaScript library (+css) in the header (gallery-lightbox-min.js) - http://yuilibrary.com/gallery/show/lightbox.
The only problem is referencing to images in form '/c/wiki/get_page_attachment?nodeId=12816&fileName=SharedImages%2Fimage.png' as they cannot be displayed this way. But this is for another thread.
JV
Joe Veliyath, modified 7 Years ago.

Jquery failing when using in PORTLET

New Member Posts: 3 Join Date: 6/29/11 Recent Posts
Hi Guys, I am a having a peculiar problem.I was trying out TABS of JQUERY in liferay. I build a new portlet to get this functionality. The good news was that the TABS worked when i added the portlet.But When i refresh the page,its not working. Why is that happening ?
P.S I have used the same example as in JQUERY tabs DEMO.
JV
Joe Veliyath, modified 7 Years ago.

RE: Jquery failing when using in PORTLET

New Member Posts: 3 Join Date: 6/29/11 Recent Posts
Joe Veliyath:
Hi Guys, I am a having a peculiar problem.I was trying out TABS of JQUERY in liferay. I build a new portlet to get this functionality. The good news was that the TABS worked when i added the portlet.But When i refresh the page,its not working. Why is that happening ?
P.S I have used the same example as in JQUERY tabs DEMO.



Looks like i found solution to the problem...

I was because of the order in which we give the .js files in the portlet.xml file.Always give smaller .js files like "jquery.core.js" first followed by "jquery.all.js"..
Always give child Js Files first.

Hope this helps someone.