Apply Background style to each page in intel xdk

61 Views Asked by At

I need help with Intel XDK, How can I apply different Background style for each page. For now, when I select one background Style to the specific page, It automatically applies to every other page.

P.S, I am developing an app in Design mode.

1

There are 1 best solutions below

0
Amir Saadallah On

you can do it throw js , by changing the style of you body depend on rout/url if you use Angularjs for example it gonna be like that

.state('home', {
    url: '/',
    templateUrl: 'index.html',
    controller: 'HomeController',
    containerClass: 'Homecss'
})
.state('otherpage', {
    url: '/otherpage',
    templateUrl: 'otherpage.html',
    controller: 'otherpageController',
    containerClass: 'otherpagecss'
}) 

then

 $rootScope.$on('$stateChangeSuccess',function(event, toState, toParams, fromState, fromParams){
        $rootScope.containerClass = toState.containerClass;
    });

and in your html

<div ng-class="{{containerClass}}">...</div>

there is also angularjs modules help to make it easy like angular-css