Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
amani kh
popup
November 27, 2012 4:18 AM
Answer

amani kh

Rank: Junior Member

Posts: 43

Join Date: November 16, 2012

Recent Posts

hi, I have a portlet in my page where on image click a popup should open. On this popup some web content is displayed.
can anyone give me a simple example how to create a popup without so much developpement ( I'am a beginner developer)
Juhi Kumari
RE: popup
November 27, 2012 4:31 AM
Answer

Juhi Kumari

Rank: Expert

Posts: 347

Join Date: December 12, 2011

Recent Posts

Hi Amani,

Try this
1<a href="javascript:show()"><img src="/images/images.jpeg"/></a>
2   
3    function show(){
4        var showWindow = window.open('<portlet:renderURL windowState="<%= LiferayWindowState.POP_UP.toString() %>"><portlet:param name="cmd" value="/show.jsp" /></portlet:renderURL>', 'slideShow', 'directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,height=400,width=500');
5        showWindow.focus();
6    }


Regards
Juhi
amani kh
RE: popup
November 27, 2012 7:23 AM
Answer

amani kh

Rank: Junior Member

Posts: 43

Join Date: November 16, 2012

Recent Posts

thank you Juhi Kumari,
I add this code to view.jsp??
Gwowen Fu
RE: popup
November 27, 2012 7:26 AM
Answer

Gwowen Fu

Rank: Expert

Posts: 315

Join Date: December 27, 2010

Recent Posts

amani kh:
I add this code to view.jsp?

Add that code to the jsp page that shows the image.

This script open the content in a new window. If you prefer a nicer popup box then consider jQuery plugin: http://collegegfx.com/10-best-jquery-popup-plugins/.