---restore content starts---
Objective:
Add a click event above the animation and call the Winfrom method via JavaScript
1. Create a page
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Security.Permissions;usingSystem.Runtime.InteropServices;namespacedemo{
Sets the range that can be called [PermissionSet (SecurityAction.Demand, Name="FullTrust")] [ComVisible (true)] Public Partial classForm1:form { PublicForm1 () {InitializeComponent (); } Private voidWebbrowser1_documentcompleted (Objectsender, WebBrowserDocumentCompletedEventArgs e) { } Public voidShowMsg (stringmsg) {MessageBox.Show (msg); } Private voidButton1_Click (Objectsender, EventArgs e) {WebBrowser2.Document.InvokeScript ("Run",New Object[] {"csharefunction" }); } Private voidWebbrowser2_documentcompleted (Objectsender, WebBrowserDocumentCompletedEventArgs e) { } Private voidForm1_Load (Objectsender, EventArgs e) { stringFlashuri ="d:/text.html"; This. Webbrowser2.url =NewUri (Flashuri); Webbrowser2.objectforscripting= This;//specifically exposed objects, where custom objects can be exposed } }}
2. HTML page
<HTML> <Head> <MetaCharSet= "Utf-8" /> </Head> <Body> <imgsrc= "Bankpay.gif"style= "position:absolute; width:100%; top:0px; left:0px; right:0px ; bottom:0px; height:100%; z-index:100;" /> <Divstyle= "position:absolute; width:100%; top:0px; left:0px; right:0px ; bottom:0px; height:100%; z-index:101;"onclick= "Run (' browser open ')">11111</Div> <Scripttype= "Text/javascript"CharSet= "Utf-8"> functionRun (str) {WINDOW.EXTERNAL.SHOWMSG (str); } </Script> </Body></HTML>
3, Note: If the use of flash, the page is not able to get to the Click event
4, Flash solution, by converting to GIF animation pictures to solve
---restore content ends---
Html,javascript calling the Winfrom method