Collapsible articles

GK User
Wed Apr 02, 2014 9:10 pm
Hello,

Is there any way to have the first item activated (tab open) when using the collapsible articles in the mobile menu?
User avatar
Senior Boarder

GK User
Fri Apr 04, 2014 3:29 pm
Could You please post an url to your site where you would like to have this behave?
User avatar
Moderator

GK User
Mon Apr 07, 2014 12:02 pm
Hello...

URL is www.t-image.com.au

on the mobile menu, i'd like the first tab to be expanded on load... just to make the page a bit more interesting...

Thanks

Bevan
User avatar
Senior Boarder

GK User
Thu Apr 10, 2014 11:52 am
Any ideas on this?
User avatar
Senior Boarder

GK User
Thu Apr 10, 2014 7:18 pm
Sorry for late repaly. You need to modify one javascript file:
templates/gk_coffe/js/mobile/gk.iphone.js
modify it on almost the end so it looks this way:
Code: Select all
   if($('.gkCollapsible').length > 0) {
      $('.gkCollapsible').each(function(i, el) {
         $(el).bind('click', function(){
            var toggled = $($('.gkFeaturedItem').get(i));
            if(toggled.css('display') == 'none' || toggled.css('display') == '') {
               $($('.gkFeaturedItem').get(i)).css('display', 'block');
               $($('.gkToggle').get(i)).attr('class', 'gkToggle hide');
            } else {
               $($('.gkFeaturedItem').get(i)).css('display', 'none');
               $($('.gkToggle').get(i)).attr('class', 'gkToggle show');
            }
         });
         
         $('a',el).bind('click', function(e) {
            e.preventDefault(); // disable links on toggler
         });
      });
   }
   $($('.gkFeaturedItem').get(0)).css('display', 'block');
   $($('.gkToggle').get(0)).attr('class', 'gkToggle hide');
});

function setCookie(c_name, value, expire) {
   var exdate=new Date();
   exdate.setDate(exdate.getDate()+expire);
   document.cookie=c_name+ "=" +escape(value) + ((expire==null) ? "" : ";expires=" + exdate.toUTCString());
}
User avatar
Moderator

GK User
Sat Apr 12, 2014 8:56 am
Thank you!!!

That works perfectly!
User avatar
Senior Boarder

GK User
Sat Apr 12, 2014 12:44 pm
Ok, if you will have any other questions regarding this topic - please ask.
User avatar
Moderator


cron