Float Button Mode on Wix
Add a floating button to your Wix website that stays visible as users scroll. This method uses Wix's Custom Code feature.
Implementation Steps
Step 1: Get Your Embed Code
- Go to your form's Embed page
- Select Wix Website
- Choose Float Button as the display mode
- Copy the generated code
Step 2: Access Wix Custom Code
- Log in to your Wix Dashboard
- Select your website
- Click Settings in the left sidebar
- Scroll to Advanced section
- Click Custom Code
Step 3: Add the Code
- Click + Add Custom Code
- Paste your embed code:
<script src="https://cdn.interactiveform.com/embed.js"></script>
<script>
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
position: 'bottom-right'
});
</script>
- Name: "Interactive Form Float Button"
- Add code to: Body - end
- Load on: All pages (or select specific pages)
- Click Apply
Step 4: Publish and Test
- Click Publish in Wix Editor
- Visit your live site
- Verify the button appears and functions correctly
Customization Options
Button Position
<script>
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
position: 'bottom-right', // 'bottom-left', 'top-right', 'top-left'
offset: {
bottom: '20px',
right: '20px'
}
});
</script>
Button Appearance
Match your Wix site design:
<script>
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
buttonText: 'Get a Quote',
buttonColor: '#116DFF', // Wix default blue
buttonTextColor: '#FFFFFF',
buttonSize: 'medium',
borderRadius: '50px' // Rounded button
});
</script>
Show/Hide Behavior
<script>
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
showAfterScroll: 300, // Show after scrolling 300px
animation: 'slide-in',
animationDelay: 1000
});
</script>
Wix-Specific Configurations
Avoid Wix Chat Conflict
If you use Wix Chat, position the button to avoid overlap:
<script>
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
position: 'bottom-left', // Wix Chat is usually bottom-right
offset: {
bottom: '20px',
left: '20px'
}
});
</script>
Responsive for Wix Mobile
Optimize for Wix mobile view:
<script>
var isMobile = window.innerWidth < 768;
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
position: isMobile ? 'bottom-center' : 'bottom-right',
buttonSize: isMobile ? 'large' : 'medium',
buttonText: isMobile ? '' : 'Contact Us', // Icon only on mobile
offset: isMobile ? {
bottom: '10px',
left: '50%',
transform: 'translateX(-50%)'
} : {
bottom: '20px',
right: '20px'
}
});
</script>
Match Wix Theme
Automatically match your Wix site colors:
<script>
// Try to detect Wix theme color
var wixThemeColor = getComputedStyle(document.documentElement)
.getPropertyValue('--wix-color-1') || '#116DFF';
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
buttonColor: wixThemeColor
});
</script>
Page-Specific Display
Show on Specific Pages Only
When adding custom code:
- Select Load code on selected pages
- Choose pages from the list
Or use JavaScript:
<script>
var currentPath = window.location.pathname;
// Show only on product and service pages
if (currentPath.includes('/product') || currentPath.includes('/service')) {
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
buttonText: 'Get Info'
});
}
</script>
Different Buttons for Different Pages
Create multiple custom code snippets:
Code 1: Product Pages
<script>
if (window.location.pathname.includes('/product')) {
InteractiveForm.init({
formId: 'PRODUCT_FORM_ID',
mode: 'float-button',
buttonText: 'Product Inquiry',
buttonColor: '#007bff'
});
}
</script>
Code 2: Service Pages
<script>
if (window.location.pathname.includes('/service')) {
InteractiveForm.init({
formId: 'SERVICE_FORM_ID',
mode: 'float-button',
buttonText: 'Book Service',
buttonColor: '#28a745'
});
}
</script>
Wix Multilingual Support
For Wix multilingual sites:
<script>
var lang = document.documentElement.lang || 'en';
var buttonTexts = {
'en': 'Contact Us',
'es': 'Contáctenos',
'fr': 'Contactez-nous',
'de': 'Kontaktieren Sie uns'
};
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
buttonText: buttonTexts[lang] || buttonTexts['en'],
language: lang
});
</script>
Testing in Wix
Preview Mode
- Open Wix Editor
- Click Preview button
- Test button appearance and position
- Click button to verify form opens
- Test on different page sections
Mobile Testing
- In Wix Editor, click Mobile icon
- Switch to mobile view
- Verify button position and size
- Test button functionality
- Check for conflicts with Wix mobile menu
Published Site Testing
- Publish your site
- Test on actual mobile devices
- Check different browsers
- Verify button doesn't overlap with Wix elements
Troubleshooting
Button doesn't appear
- Check custom code is added to Body - end
- Verify code is applied to correct pages
- Check browser console for errors
- Ensure Wix site is fully loaded
Button overlaps with Wix elements
- Adjust position and offset
- Check z-index conflicts
- Move button to different corner
- Reduce button size
Button not visible on mobile
- Test in Wix mobile editor
- Adjust mobile-specific settings
- Check if hidden by Wix mobile menu
- Verify responsive configuration
Conflicts with Wix Chat
- Position button on opposite side
- Adjust z-index values
- Consider disabling one feature
- Contact support for advanced solutions
Button appears multiple times
- Check for duplicate custom code entries
- Verify only one code snippet per page
- Remove old/test code snippets
Best Practices for Wix
- Test in Preview: Always test before publishing
- Mobile First: Optimize for mobile users
- Avoid Conflicts: Check for Wix Chat and other floating elements
- Page Load: Add slight delay to ensure Wix loads completely
- Consistent Design: Match button style with Wix theme
- Clear CTA: Use descriptive button text
- Accessibility: Ensure button is keyboard accessible
Advanced: Wix Velo Integration
If you use Wix Velo (formerly Corvid), you can add more advanced functionality:
// In Wix Velo code
$w.onReady(function () {
// Initialize form after Wix is ready
if (typeof InteractiveForm !== 'undefined') {
InteractiveForm.init({
formId: 'YOUR_FORM_ID',
mode: 'float-button',
onFormSubmit: function(data) {
// Custom Wix logic after form submission
console.log('Form submitted:', data);
// You can trigger Wix animations, update Wix database, etc.
}
});
}
});
Next Steps
- Learn about Popup mode on Wix
- Learn about Inline embedding on Wix
- Explore Manual Embedding for more options