基础显示模态超出可见区域

时间:2015-12-04 20:13:41

标签: javascript jquery css ruby-on-rails zurb-foundation

我试图在rails应用程序中使用Foundation 5来使用模态

问题是,如果你没有向下滚动页面,那么模态就可以了。

如果你转到底部并单击模态按钮,当它激活时,它不会显示。

这是否有错误或我做错了什么?

public class MapActivity extends MenuActivity {

private final static String TAG = "HearingTest";
private WebView webView;
private String urlString;
private ProgressDialog progressDialog;
private Context context;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.map_layout);

   context = MapActivity.this;

    urlString = getString(R.string.location_url);

    WebViewSettings();

    LoadWebPage(urlString);

    AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {

        @Override
        protected void onPreExecute() {
            progressDialog = new ProgressDialog(context);
            progressDialog.setTitle("Loading...");
            progressDialog.setMessage("Please wait.");
            //progressDialog.setCancelable(false);
            progressDialog.setIndeterminate(true);
            progressDialog.show();
        }

        @Override
        protected Void doInBackground(Void... arg0) {
            try {
                //Do something...
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return null;
        }

        @Override
        protected void onPostExecute(Void result) {
            if (progressDialog!=null) {
                progressDialog.dismiss();
            }
        }
    };

    task.execute((Void[])null);
}

public void LoadWebPage(String url){

    try {
        webView.loadUrl(url);
        Log.d(TAG, "URL" + url + "connected");
    } 
    catch (Exception e) {
            Log.d(TAG, "URL: " + url + " couldn't connect.");
    }
}

public void WebViewSettings(){

    webView = (WebView) findViewById(R.id.webview);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setBuiltInZoomControls(true);
    webView.getSettings().setSupportZoom(true);
    webView.getSettings().setLoadWithOverviewMode(true);

    webView.setWebViewClient(new WebViewClient(){

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if (Uri.parse(url).getHost().equals(urlString)) {
                // This is my web site, so do not override; let my WebView load the page
                return false;
            }
            // Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
            startActivity(intent);
            return true;
        }

        @Override
        public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
             handler.proceed();
        }
    });
}

    protected void DisplayProgressBar(){

    }
}

1 个答案:

答案 0 :(得分:1)

我不认为这是一个错误,应根据您的情况对脚本进行修改。您可以通过将模式设置为“固定”而不是“绝对”来修改模态的css属性。 但是要注意在较小的屏幕上查看时添加一些代码,其中模式可能太高而且有溢出。