You need to sign in to do that
Don't have an account?

I have used lightning component in visualforce page. I got this code from one of the website. But flipcard background color is not working please help me...
App:
- <aura:application access="global" extends="ltng:outApp">
- <aura:dependency resource="c:flipCard" />
- </aura:application>
- <aura:component >
- <aura:attribute type="string" name="bgColor" />
- <aura:attribute type="string" name="fontColor" default="#000"/>
- <aura:attribute type="string" name="borderColor" default="#000"/>
- <aura:attribute type="string" name="frontText" />
- <aura:attribute type="string" name="backText" />
- <aura:attribute type="boolean" name="isVerticalFlip" default="false" description="By default its Horizontal flip" />
- <div class="{! 'slds flip-container ' + (v.isVerticalFlip == false ? 'horizontal' : 'vertical') }" style="{! 'background-color:'+ v.bgColor+'; color: '+ v.fontColor+';border : 1px solid '+ v.borderColor}">
- <div class="flipper">
- <div class="front">
- {!v.frontText}
- </div>
- <div class="back">
- {!v.backText}
- </div>
- </div>
- </div>
- </aura:component>
- .slds.THIS{
- padding : 10px;
- margin : 10px;
- display: inline-block;
- border-radius: 15px;
- text-align: center;
- font-size : 2em;
- }
- .THIS .flip-container {
- perspective: 1000px;
- }
- /* hide back while swapping*/
- .THIS .front, .THIS .back {
- backface-visibility: hidden;
- position: absolute;
- top: 0;
- left: 0;
- }
- .THIS.flip-container, .THIS .front, .THIS .back {
- width: 100%;
- height: 100%;
- }
- .THIS .front {
- z-index: 2;
- }
- /* Flip Speed */
- .THIS .flipper {
- transition: 0.6s;
- transform-style: preserve-3d;
- position: relative;
- }
- .THIS.flip-container.horizontal:hover .flipper, .THIS.flip-container.horizontal.hover .flipper {
- transform: rotateY(180deg);
- }
- .THIS.horizontal .front {
- transform: rotateY(0deg);
- }
- /* back, initially hidden pane */
- .THIS.horizontal .back {
- transform: rotateY(180deg);
- }
- .THIS.flip-container.vertical:hover .flipper, .THIS.flip-container.vertical.hover .flipper {
- transform: rotateX(180deg);
- }
- .THIS.vertical .front {
- transform: rotateX(0deg);
- }
- /* back, initially hidden pane */
- .THIS.vertical .back {
- transform: rotateX(180deg);
- }
- <apex:page >
- <apex:includeLightning />
- <div style="width:50%;height:150px;" id="flipCardId" />
- <script>
- $Lightning.use("c:lightningOutAppContainer",
- function(){
- $Lightning.createComponent("c:flipCard",
- {
- borderColor: "green",
- bgColor:"white",
- fontColor:"red",
- frontText:"What is a cool about Lightning Component Development",
- backText:"You do not need to enable Lightning experience, it will work on Classic instance as well"
- },
- "flipCardId",
- function(cmp){
- console.log('Component created, do something cool here')
- });
- });
- </script>
- </apex:page>
Oh my god its working now, how it would be like that. Before this i have changed bgcolor to red , green, blue it was always white. now its working why i don't know. Sorry if i was did a mistake on checking.
bgColor:"green",.............. its working fine now. Is there any chances that page behaves wrong sometimes.
All Answers
Thanks !!
Deepak Kumawat (Deny)
Oh my god its working now, how it would be like that. Before this i have changed bgcolor to red , green, blue it was always white. now its working why i don't know. Sorry if i was did a mistake on checking.
bgColor:"green",.............. its working fine now. Is there any chances that page behaves wrong sometimes.