Ankuj Rana
Ankuj Rana

Reputation: 41

Remove javascript property from Android webview

Hi I want to remove sticky property from reviewButtonVm.positionStaticStyle class in Android Webview.

Below is the javascript code for this

<button>
 <div ng-class="hashButtonVm.positionStaticStyle" class="sticky">
</button>

I tried below webview code

@Override 
public void onPageFinished(final WebView view, String url) {
    super.onPageFinished(view, url);
    view.loadUrl("javascript:$('.hashButtonVm').removeClass('sticky');");
}

but somehow its not working.

Upvotes: 3

Views: 423

Answers (1)

Saurabh
Saurabh

Reputation: 995

Try this in your onPageFinished method

 "$('button .sticky').removeClass('sticky');"

Its working for me.

Upvotes: 1

Related Questions