문제

I'm using a custom theme registered the js in the skin.xml and created a folder in the browser with the script.

The script from a user here:

$(document).ready(function(){

    if( localStorage.theme )
        $('link#theme').attr('href', localStorage.theme);

    $('#scheme1').click(function(){
        $('link#theme').attr('href', "scheme1.css");
        localStorage.theme = "scheme1.css;"
    })

    $('#scheme2').click(function(){
        $('link#theme').attr('href', "scheme2.css");
        localStorage.theme = "scheme2.css;"
    })

});

In my main template I put:

<link  id='theme'  href type='text/css' rel="stylesheet" />

now I want to "call" this script when I use this code

<a id='scheme1' href='#'>Click</a>

in a template. With the scheme1.css

.footer{
    background: #000;
}

The color should change but I somehow the script isn't working. Any ideas?

도움이 되었습니까?

해결책

If you want your js file be registered, you have to add it in the jsregistery.xml in your profile folder.

This will add it to the portal_javascript and then your script will be loaded in your page.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top