0
How can I disappear with the action of Parallax when it is with an attribute?
this is the tag that has the attribute:
<parallax-image ng-class="{{fixo}}"
src="/parallax-image/assets/images/image-01.jpg"></parallax-image>
This is the css that has the attribute:
[class^="fixo"] {
background-color: color($grey, 200);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
display: block;
height: 0;
overflow: hidden;
padding-bottom: 40%;
position: relative;
width: 100%;
}
And this is you:
if ('.fixo' == true) {
return true;
} else {
return false;
}
Hello Celsom I put it this way: the script looks like this: <script> Scope.haseffect = true; Scope.haseffect = (Scope.haseffect === 'false') ? false : Scope.haseffect; </script>
– Marcos
And the html looks like this: <div ng-class="{'Parallax-image-{{index}}': haseffect, 'Fixed': ! haseffect}" ng-if="src"> <div class="Parallax-image-overlay" ng-if="alt" horizontal layout center-Justified fit> <p>{{alt}}</p> </div> </div>
– Marcos
But it seems that css is not loading.
– Marcos
@Are you putting that script directly into the body of the page? If so, it won’t even work. Must be linked to a controller (or Directive - or other equivalent method),
– celsomtrindade
It is linked to a controler yes @Celsomtrindade...so I put the code for you to see... The script is working from what I saw on the console, but the css I created for Fixed it is not returning.
– Marcos
Check that the class Fixed is being added to the element. If it is not, make sure that the value of
hasEffect
is being updated because the statement seems to me all right.– celsomtrindade