Featured Posts

Introducing Portlet Generator 1.0 I've just added the portlet generator utility to this site.  This utility replaces the "create.bat" and "create.sh" scripts that come with Liferay's PluginSDK.  It offers...

Readmore

Hello Struts Portlet I've placed a very simple Hello Struts portlet in the downloads section. It doesn't do nearly enough to show the power of Struts in Liferay. Look for a future Struts portlets...

Readmore

Hello jQuery Portlet I was recently asked: "What is jQuery?". By now, most Javascript enthusiasts understand the advantages of jQuery's power. To demonstrate one of those advantages, I've added...

Readmore

Hello Spring Portlet I've placed a simple, Hello World type Spring portlet in the downloads section. Check it out. It uses the Spring ParameterizableViewController to forward to the view JSP.

Readmore

Using jQuery with Liferay, Part 2 Four more core effects are Show, Toggle, Fade In, and Animate.   This week's portlet and the screencast below gives a demonstration of these four effects in a Liferay Portlet....

Readmore

RobiSoft.com Rss

Using jQuery with Liferay, Part 2

Posted on : 12-08-2009 | By : Jeff Robinson | In : Tutorials

Tags: , ,

2

Four more core effects are Show, Toggle, Fade In, and Animate.   This week’s portlet and the screencast below gives a demonstration of these four effects in a Liferay Portlet. As I should have mentioned last time, the code within the portlet to do one of these effects is very small. Here’s the code for the toggle:

jQuery('#link2').click(function() { jQuery('# block2').toggle();});

Of course, you have to setup a “div” with a unique “id=”. For portlets, we simply prepend the tag which makes the id unique across the portal. Take a look at the source code in the portlet’s view.jsp file for more information. I tried to keep the jQuery code clean and simple so beginners shouldn’t have to cringe too much ;-) .

Comments (2)

I have been trying to use your examples but I am having some issues deploying them to my liferay instance.

I’ll do what I can to help. Can you tell me which Liferay version, OS, and Application Server you’re using? Or, zip up your source folder and send it to me. I can also send you a zip file of the Plugin SDK folder I used.

Just let me know what works for you.

Rgrds,
JR

Write a comment