掲示板

Jquery Accordion Issue

thumbnail
14年前 に path finder liferay によって更新されました。

Jquery Accordion Issue

Expert 投稿: 262 参加年月日: 09/09/18 最新の投稿
hello every one,

Jquery accordion is working for only one portlet at a time

i've included my custom jquery accordion definition inside the theme and deployed it as shown below



jQuery(
	function() {
		if (Liferay.Browser.isIe() && Liferay.Browser.getMajorVersion() < 7) {
			jQuery('#navigation > ul > li').hover(
				function(event) {
					jQuery(this).addClass('hover');
				},
				function(event) {
					jQuery(this).removeClass('hover');
				}
			);
		}
        
	[b][i]
          jQuery("#accordion").accordion({
            header:'div.slide',
            alwaysOpen: false,
            active:false,
            autoheight: false 
           });
[/i][/b]
	}
);


Its working fine for one portlet but not working for other portlets when i want to use same accordion for other portlets
i've followed same steps as i followed for first portlets like i div id and also slide class in other portlet also


Please help me to get out of this issue

regards,
Path Finder
thumbnail
14年前 に path finder liferay によって更新されました。

RE: Jquery Accordion Issue

Expert 投稿: 262 参加年月日: 09/09/18 最新の投稿
someone please reply to this post
14年前 に Oliver Bayer によって更新されました。

RE: Jquery Accordion Issue

Liferay Master 投稿: 894 参加年月日: 09/02/18 最新の投稿
Hi,

not sure if thats the case but you shouldn't use the same id (#naavigation) in more than one portlet. The css id has to be unique.

HTH Oli
thumbnail
14年前 に path finder liferay によって更新されました。

RE: Jquery Accordion Issue

Expert 投稿: 262 参加年月日: 09/09/18 最新の投稿
Oliver Bayer:
Hi,

not sure if thats the case but you shouldn't use the same id (#naavigation) in more than one portlet. The css id has to be unique.

HTH Oli



Thanks for your reply Bayer

You are right id has to be unique but how do i have to define in our custom theme java script
if i define my id in this way

<portlet:namespace />accordion


then how to define in javascript of our themes i've tried in this way
jQuery('#<portlet:namespace />accordion').accordion({blah blah blah});


its not working emoticon

somebody please help me
14年前 に Mazhar Anwar によって更新されました。

RE: Jquery Accordion Issue

Regular Member 投稿: 125 参加年月日: 10/02/05 最新の投稿
Hi,

Can you put your accordian code in portlet jsp itself above you div id="accordionA"?
<script type="text/html">
    jQuery("#accordionA").accordion({
      header:'div.slide',  
      alwaysOpen: false,
      active:false,
      autoheight: false
    });
</script>


you can use 2 different Ids in that case, different for different portlets.

HTH,
Regards,
Mazhar