jquery-ui – 设置jquery ui的对话框模态宽度?

前端之家收集整理的这篇文章主要介绍了jquery-ui – 设置jquery ui的对话框模态宽度?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
您好

我正在使用this demo显示模态对话框

如果我将其用于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 );
原文链接:https://www.f2er.com/jquery/182951.html

猜你在找的jQuery相关文章