bonjour,
depuis ce matin je me bats avec ça:
ma page html:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80 package com.ibsissoko.android; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.GestureDetector.OnGestureListener; import android.view.View.OnClickListener; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.webkit.WebView; import android.widget.Button; import android.widget.ImageButton; import android.widget.ViewFlipper; public class Test3webkitsActivity extends Activity { /* * Constante permettant de calculer si l'on doit tourner page vers gauche ou * droite selon la position du doight */ private static final int SWIPE_MIN_DISTANCE = 120; private static final int SWIPE_MAX_OFF_PATH = 250; private static final int SWIPE_THRESHOLD_VELOCITY = 200; /* * Declaration de variable Animation (creation de dossier de gestier d'une * animation ds repertoir anim) GestureDetector composant qui permet de * detecter un evenement ViewFlipper composant qui permet de gerer une * transition via animation */ WebView webView; private GestureDetector detector; private ViewFlipper view; private Handler handler; private static final String HTML_ROOT = "file:///android_asset/www/"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main1); webView = new WebView (this); setContentView(webView); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setDomStorageEnabled(true); handler = new Handler(); //webView.addJavascriptInterface(this, "contactSupport"); loadPage("index.html"); } public void loadPage(String in) { final String url = HTML_ROOT + in; loadURL(url); } private void loadURL(final String in) { handler.post(new Runnable() { public void run() { webView.loadUrl(in); } } ); } }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84 <!DOCTYPE HTML> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="css/jquery.mobile-1.0a3.min.css" /> <script type="text/javascript" src="jquery-1.4.4.min.js"></script> <script type="text/javascript" src="jquery.touchSwipe-1.2.5.js"></script> <title>touchSwipe</title> <style> #test { width:500px; height:300px; background:#FF00FF; } #info { width:500px; } </style> </head> <body> <div id="info" > <b><a href="http://labs.skinkers.com/touchSwipe/">TouchSwipe</a> Demo - to be viewed on touch based devices</b><br/> <br/> <b>Basics 1 - swipe</b> <br>By using the <i>swipe</i> handler, you can detect all 4 directions, or use the individual methods <i>swipeLeft</i>, <i>swipeRight</i>, <i>swipeUp</i>, <i>swipeDown</i></br> </div> <br/> <a href="basics_2.php"/>Next</a> <div id="test">Swipe me</div> <a href="basics_2.php"/>Next</a> <script> //Assign handlers to the simple direction handlers. var loVar; $(document).ready(function () { loVar = $('#test'); showProgress(); //Enable swiping... //$("#test").swipe( swipeOptions ); //contactSupport.('#test').html('c moi!'); }); function showProgress(){ loVar.hide(); } //Swipe handlers. //The only arg passed is the original touch event object //function swipe(event, direction) //{ // $("#test").text("You swiped " + direction ); //} </script> </body> </html>
J'essaies d'inclure du jquerymobile dans ma page html. mais jquery ne s'execute pas.
j'ai testé beaucoup de choses....
je me demande si webkit ne bloque pas le JS...
Un simple hide en jquery ne fcte pas
est ce possible ?
merci pour vos pistes ??
Ib
Partager