You need to sign in to do that
Don't have an account?
Katie Silorio
Mouseover icon on lightning component
This is probably a super simple question... I built a lightning component that consists of images and direct you to different pages when you click on them.
The buttons work fine, but the cursor doen't change to a pointer icon when you hover over the image. Please help me update my code:
Component
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<div class="c-container">
<div class="slds-grid slds-grid_align-center">
<div class="slds-col slds-p-right_xx-large" onclick="{!c.startNewApplication}">
<img src="{!$Resource.LexPartnerPortalCreateNCA}"/>
</div>
<div class="slds-col slds-p-right_xx-large" onclick="{!c.createLendingCircle}">
<img src="{!$Resource.LexPartnerPortalCreateLC}"/>
</div>
</div>
</div>
</aura:component>
Controller
({
startNewApplication : function (cmp, event, helper) {
window.location.href = '/lightningPartners/PublicClientApplication';
},
createLendingCircle : function (cmp, event, helper) {
window.location.href = '/lightningPartners/partnercreatelendingcircle';
},
submitACase: function (cmp, event, helper) {
window.location.href = '/lightningPartners/s/createrecord/NewCase';
}
})
The buttons work fine, but the cursor doen't change to a pointer icon when you hover over the image. Please help me update my code:
Component
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<div class="c-container">
<div class="slds-grid slds-grid_align-center">
<div class="slds-col slds-p-right_xx-large" onclick="{!c.startNewApplication}">
<img src="{!$Resource.LexPartnerPortalCreateNCA}"/>
</div>
<div class="slds-col slds-p-right_xx-large" onclick="{!c.createLendingCircle}">
<img src="{!$Resource.LexPartnerPortalCreateLC}"/>
</div>
</div>
</div>
</aura:component>
Controller
({
startNewApplication : function (cmp, event, helper) {
window.location.href = '/lightningPartners/PublicClientApplication';
},
createLendingCircle : function (cmp, event, helper) {
window.location.href = '/lightningPartners/partnercreatelendingcircle';
},
submitACase: function (cmp, event, helper) {
window.location.href = '/lightningPartners/s/createrecord/NewCase';
}
})
Add the below changes in Component and add the CSS on bundle Style.
Component:
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<div class="c-container">
<div class="slds-grid slds-grid_align-center">
<div class="slds-col slds-p-right_xx-large" onclick="{!c.startNewApplication}">
<img src="{!$Resource.LexPartnerPortalCreateNCA}" class="pointer"/>
</div>
<div class="slds-col slds-p-right_xx-large" onclick="{!c.createLendingCircle}">
<img src="{!$Resource.LexPartnerPortalCreateLC} class="pointer"/>
</div>
</div>
</div>
</aura:component>
===========
In Style add the below CSS:
.THIS .pointer{
cursor: pointer;
}
Thanks,
Maharajan.C
All Answers
Add the below changes in Component and add the CSS on bundle Style.
Component:
<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<div class="c-container">
<div class="slds-grid slds-grid_align-center">
<div class="slds-col slds-p-right_xx-large" onclick="{!c.startNewApplication}">
<img src="{!$Resource.LexPartnerPortalCreateNCA}" class="pointer"/>
</div>
<div class="slds-col slds-p-right_xx-large" onclick="{!c.createLendingCircle}">
<img src="{!$Resource.LexPartnerPortalCreateLC} class="pointer"/>
</div>
</div>
</div>
</aura:component>
===========
In Style add the below CSS:
.THIS .pointer{
cursor: pointer;
}
Thanks,
Maharajan.C
This worked! Thank you so much!
Katie
Yes you are right. Its just css. Please find the below code:
Please let us know if you have any queries.
Enjoy Coding!!!!!
Thanks,
SfdcCouple
Reach us @ sfdccouple@gmail.com