views:

61

answers:

1

Hello StackOverflow'ers,
I have a (flex) app that, on the click of a button, resize a div (in javascript) at the bottom of the page and shows your position in google street view in it.

The things is that if I open the browser at 80% of width, click on the button and then maximize the window, the div won't take 100% of width. I have a function that his being called 'onResize' on the body tag of the page, but it doesn't seems to work. Here is the code :

...

function handleResize()
{
 document.getElementById('streetviewDiv').style.width='100%';
}

...

<body onResize="handleResize()">

How can I achieve the auto-resize of the street view? There must be a specific id for that object so that we could get it by javascript, but I haven't found it.

Thanks

A: 

You're going to have to show some of the markup and CSS. There could be any number of reasons why you're not getting a resize. Normal DIV behavior is, absent any width setting, to expand horizontally to fill the parent container. So either your div is being constrained by a parent element or something else weird is going on.

It could also so happen that the div is expanding but its visible contents is not, if your StreetView object is what you expect to expand but doesn't.

Robusto
If I'm correct, google street view is a flash object that is being inserted in my div 'streetviewDiv', so it's probably this object that I need to resize, not the div.
Frank
Then you should probably see if the <embed> markup for the Flash movie has a hard-coded width.
Robusto
That's what I'm doing right now. I'll let you know.
Frank
Using javascript:alert(document.getElementById('streetviewDiv').innerHTML) I found the id of the flash object (panoflash1). In the onResize() function I simply add document.getElementById('panoflash1').width='100%'.
Frank