您好
如果我将其用于google街景视图,我如何设置对话框的宽度:
var point = new GLatLng(svlat,svlon); var panoClient = new GStreetviewClient(); panoClient.getNearestPanoramaLatLng(point,function (newPoint) { if (newPoint == null) { alert("no panorama found for this position!!"); return; } panoramaOptions = { latlng: newPoint }; myPano = new GStreetviewPanorama(document.getElementById("pano"),panoramaOptions); $('#dialogStreetView').dialog("option","maxWidth",600); $('#dialogStreetView').dialog('open'); GEvent.addListener(myPano,"error",handleNoFlash); });
HTML:
<div id="dialogStreetView" title="Street View Provided by Google... " style="width:300px;height:300px"> <a id="closestreet-view" name="closestreet-view" style="cursor:pointer; text- decoration:underline" >Close</a> <div name="pano" id="pano" style="width: 300px; height: 300px"></div> </div>
解决方法
从文档:
> http://docs.jquery.com/UI/Dialog
这应该工作:
$("#dialogStreetView").dialog( "option","width",460 );