フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Path Finder LifeRay
Jquery Accordion Issue
2010/04/23 1:38
答え

Path Finder LifeRay

ランク: Expert

投稿: 262

参加年月日: 2009/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


 1
 2jQuery(
 3    function() {
 4        if (Liferay.Browser.isIe() && Liferay.Browser.getMajorVersion() < 7) {
 5            jQuery('#navigation > ul > li').hover(
 6                function(event) {
 7                    jQuery(this).addClass('hover');
 8                },
 9                function(event) {
10                    jQuery(this).removeClass('hover');
11                }
12            );
13        }
14       
15    [b][i]
16          jQuery("#accordion").accordion({
17            header:'div.slide',
18            alwaysOpen: false,
19            active:false,
20            autoheight: false
21           });
22[/i][/b]
23    }
24);


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
Path Finder LifeRay
RE: Jquery Accordion Issue
2010/04/23 1:39
答え

Path Finder LifeRay

ランク: Expert

投稿: 262

参加年月日: 2009/09/18

最近の投稿

someone please reply to this post
Oliver Bayer
RE: Jquery Accordion Issue
2010/04/23 3:34
答え

Oliver Bayer

ランク: Liferay Master

投稿: 883

参加年月日: 2009/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
Path Finder LifeRay
RE: Jquery Accordion Issue
2010/04/23 4:11
答え

Path Finder LifeRay

ランク: Expert

投稿: 262

参加年月日: 2009/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

1<portlet:namespace />accordion


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


its not working emoticon

somebody please help me
Mazhar Anwar
RE: Jquery Accordion Issue
2010/04/23 5:03
答え

Mazhar Anwar

ランク: Regular Member

投稿: 125

参加年月日: 2010/02/05

最近の投稿

Hi,

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


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

HTH,
Regards,
Mazhar