TheFinestArtist / FinestWebView-Android

Beautiful and customizable Android Activity that shows web pages within an app.
https://finestwebview.web.app
2.32k stars 532 forks source link

JS Redirect to id in same page #149

Open neel-dabhi opened 6 years ago

neel-dabhi commented 6 years ago

Unable to jump to particular div id in HTML page

My Code: new FinestWebView.Builder(getActivity()) .titleDefault("Maths Tricks") .showSwipeRefreshLayout(false) .toolbarScrollFlags(0) .theme(R.style.WebView) .webViewBuiltInZoomControls(false) .webViewDisplayZoomControls(false) .dividerHeight(5) .titleSize(50) .showUrl(false) .updateTitleFromHtml(false) .gradientDivider(true) .showIconMenu(false) .webViewJavaScriptEnabled(true) .injectJavaScript(" function() { \" +\n" + " \"document.getElementById('3')[0].style.display='none'; \" +\n" + " \"}" ) .setCustomAnimations(R.anim.activity_open_enter, R.anim.activity_open_exit, R.anim.activity_close_enter, R.anim.activity_close_exit) .show("file:///android_asset/geometry/index.html");