Search code examples
javascriptsqueezebox

Change size of SqueezeBox using javascript


Hi I have this JS CODE

function openPopup(url)
{

    var newElem = new Element( 'div' );
    newElem.setAttribute('rel','handler');
    newElem.setAttribute('class','modal');
    SqueezeBox.setContent( 'adopt', newElem );
    SqueezeBox.setContent( 'iframe', url);

}

This open a popup with the given URL.I'd like to change the size of the SqueezeBox how to do it?


Solution

  • Please try SqueezeBox.resize({x: 350, y: 400});

    Of course you have to resize your content also, as in

    SqueezeBox.initialize({
        size: {x: 350, y: 400}
    });
    
    var newElem = new Element( 'div' );
    newElem.appendText("Some Text");
    newElem.setStyle('border', 'solid 2px black');
    newElem.setStyle('width', '300px');
    SqueezeBox.setContent('adopt', newElem);
    
    SqueezeBox.resize({x: 750, y: 400})
    newElem.setStyle('width', '700px');