Appearance
Enquiry button
The Enquiry Button component is used to display a button that opens the enquiry form when clicked.
Usage
To use the Enquiry Button component, you need to include the Advance SDK script on your page and then mount the Enquiry Button component.
Refer to the Installation guide for instructions on how to include the Advance SDK script on your page.
To mount the Enquiry Button component, use the following code:
js
AdvanceSDK.init('mount', {
component: 'EnquiryButton',
buttonText: 'Send Enquiry'
});
This code will automatically mount the Enquiry Button component as a floating button on the page.
Mount to a specific element
You can also mount the Enquiry Button component to a specific element on the page by providing the container
parameter:
js
AdvanceSDK.init('mount', {
component: 'EnquiryButton',
container: '#enquiry-button-container',
buttonText: 'Send Enquiry',
});
TIP
Make sure the element with the ID enquiry-button-container
exists on the page. The Enquiry Button component will be mounted inside this element. We recommend using a div
with id
element for this purpose.
Parameters
The Enquiry Button component accepts the following parameters:
component
(required): The name of the component. Set this toEnquiryButton
.listingId
(optional): The unique ID from the CRM of the listing.container
(optional): The CSS selector of the element to mount the component to. If not provided, the component will be mounted as a floating button on the page.1buttonText
(optional): The text to display on the button. Default isSend Enquiry
.buttonBottomPosition
(optional): The distance from the bottom of the page to display the button. Default is30px
. This parameter is only used when the component is mounted as a floating button.
Unmounting
To unmount the Enquiry Button component, use the following code:
js
window.AdvanceSDK.unmount();
This is useful if your page is a single-page application and you want to remove the component when navigating to a different page.