[Koha] JQuery Help to Choose Tab

Fridolin SOMERS fridolin.somers at biblibre.com
Wed Jun 4 02:25:43 NZST 2014


Much faster and simple : each page (intranet and opac) has an id on the 
body :
For example for mainpage :

$(document).ready(function(){
   $("body#main_intranet-main #header_search 
a[href='#catalog_search']").click();
});

Le 03/06/2014 15:19, Nicole Engard a écrit :
> On Tue, Jun 3, 2014 at 12:58 AM, Fridolin SOMERS <
> fridolin.somers at biblibre.com> wrote:
>
>>
>> $(document).ready(function(){
>>    $("#header_search a[href='#catalog_search']").click();
>> });
>
>
>
> That works on every page in the staff client, but if I wanted it to work on
> the main page only so I edited it like this:
>
> $(document).ready(function(){
> if (window.location.href.indexOf("cgi-bin/koha/mainpage.pl") > -1) {
> $("#header_search a[href='#catalog_search']").click();
> }
>
> });
>
> And it's perfect!!! Thanks Fridolin!
>

-- 
Fridolin SOMERS
Biblibre - Pôles support et système
fridolin.somers at biblibre.com


More information about the Koha mailing list