FitMix Developer Documentation

Basic

Example

HTML Code

<div id="tryOnArea"></div>
<button data-skunumber="259262" class="TryOn">259262</button>
<button data-skunumber="223065" class="TryOn">223065</button>
<button data-skunumber="177280" class="TryOn">177280</button>

Javascript Code

window.onload = function()
{
    var vFitMix = new Fb.FitMix(
        {
            container: '#tryOnArea',
            skunumber: '259262',
            customerid: 'showroom',
            language: 'fr',
            messages:
            {
                SwitchToFitPhoto: 'Essayage photo',
                SwitchToFitLive: 'Essayage vidéo',
                RedetectYouFace: 'Redétecter votre visage',
                TakeSnapshot: 'Prendre un instantané',
                SwitchToFitViewer: 'Vue photo',
                TakePhoto: 'Prendre une photo',
                Cancel: 'Annuler',
                LoadPhoto: 'Charger une photo',
                TakePhotoWebcam: 'Photo webcam',
                Share: 'Partager'
            }
        }
    );
    
    var vElements = (document.querySelectorAll) ? 
        document.querySelectorAll('.TryOn') : 
        document.getElementsByClassName('TryOn') ;
    
    if(vElements)
    {
        for(i = 0;i < vElements.length;i++)
        {
            vElements[i].onclick = function()
            {
                vFitMix.SetFrame(this.getAttribute('data-skunumber'));
            }
        }
    }
}