Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript > Bibliothèques & Frameworks > jQuery
jQuery Forum d'entraide sur le framework jQuery. Avant de poster : Tutoriels jQuery, FAQ jQuery, Tous les tutoriels JavaScript, Toutes les FAQ JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 18/06/2011, 11h24   #1
Membre Expert
 
Avatar de beegees
 
Homme David Vincent (l'homme qui a vu les extra-terrestres)
Développeur Web
Inscription : mars 2004
Messages : 3 239
Détails du profil
Informations personnelles :
Nom : Homme David Vincent (l'homme qui a vu les extra-terrestres)
Âge : 37
Localisation : Belgique

Informations professionnelles :
Activité : Développeur Web
Secteur : Enseignement

Informations forums :
Inscription : mars 2004
Messages : 3 239
Points : 1 046
Points : 1 046
Par défaut Boite de dialogue ne s'affiche pas

Bonjour à tous,

Je voudrais utiliser ce genre de boite de dialogue :

http://dev.iceburg.net/jquery/jqModal/

Citation:
. Modal, Nested Modal -- a. view (4a.html), b. view (4b.html)
Focus can be forced on a dialog, making it a true "modal" dialog. Also exemplified is the ajax attribute selector (using @href). Any DOM attribute can be used to extract the ajax url (see the documentation).
J'ai pour cela mis le code dans le head de ma page :

Code :
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
// notice that you can pass an element as the target 
			//  in addition to a string selector.
			$('#btn_histroy').click(function(){
				var t = $('#ex4 div.jqmdMSG');
 
				$('#ex4').jqm({
				trigger: 'a.ex4Trigger',
				ajax: '@href', /* Extract ajax URL from the 'href' attribute of triggering element */
				target: t,
				modal: true, /* FORCE FOCUS */
				onHide: function(h) { 
				t.html('Please Wait...');  // Clear Content HTML on Hide.
				h.o.remove(); // remove overlay
				h.w.fadeOut(888); // hide window
 
				},
				overlay: 0});
 
				// nested dialog
				$('#ex4c').jqm({modal: true, overlay: 10, trigger: false});
 
				// Close Button Highlighting Javascript provided in ex3a.
 
 
	// Work around for IE's lack of :focus CSS selector
				if($.browser.msie)
				$('input')
				.focus(function(){$(this).addClass('iefocus');})
				.blur(function(){$(this).removeClass('iefocus');});
J'ai téléchargé et référencé (dans le head) le fichier (jqModal.js - 2.97k) et le fichier (jqModal.css - 496 bytes)

J'obtiens cette erreur :

Citation:
missing } after function body
Tant que j'y suis, je me demandais aussi comment je pourrais alimenter cette boite de dialogue avec des informations d'une bd mysql ?

Merci d'avance.

beegees
__________________
beegees est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 18/06/2011, 11h33   #2
Membre éclairé
 
Homme
Webmaster
Inscription : septembre 2007
Messages : 376
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Webmaster
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : septembre 2007
Messages : 376
Points : 377
Points : 377
Salut si je reprends le code que tu nous a donné, il manque :

à la fin ce qui donnerait :

Code javascript :
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
$('#btn_histroy').click(function(){
var t = $('#ex4 div.jqmdMSG');
				
$('#ex4').jqm({
   trigger: 'a.ex4Trigger',
   ajax: '@href', /* Extract ajax URL from the 'href' attribute of triggering element */
   target: t,
   modal: true, /* FORCE FOCUS */
   onHide: function(h) { 
      t.html('Please Wait...');  // Clear Content HTML on Hide.
      h.o.remove(); // remove overlay
      h.w.fadeOut(888); // hide window
   },
   overlay: 0
});
				
// nested dialog
$('#ex4c').jqm({modal: true, overlay: 10, trigger: false});

// Close Button Highlighting Javascript provided in ex3a.
// Work around for IE's lack of :focus CSS selector

if($.browser.msie)
$('input')
   .focus(function(){$(this).addClass('iefocus');})
   .blur(function(){$(this).removeClass('iefocus');});
				
});
Finality est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 18/06/2011, 11h49   #3
Membre Expert
 
Avatar de beegees
 
Homme David Vincent (l'homme qui a vu les extra-terrestres)
Développeur Web
Inscription : mars 2004
Messages : 3 239
Détails du profil
Informations personnelles :
Nom : Homme David Vincent (l'homme qui a vu les extra-terrestres)
Âge : 37
Localisation : Belgique

Informations professionnelles :
Activité : Développeur Web
Secteur : Enseignement

Informations forums :
Inscription : mars 2004
Messages : 3 239
Points : 1 046
Points : 1 046
Salut,

Je te remercie pour ta réponse qui me fait avancer.

Je n'ai plus de message d'erreur, par contre, la boite ne s'affiche pas.

Voici le code de mon bouton à partir duquel l'évènement s'enclenche :

Code :
<input type="button" value="History" id="btn_history" />
J'ai donc mis un span comme indiqué dans le code :

Je peux te passer le lien du site en privé.

Qu'en penses-tu ?

Merci pour ton aide.

beegees
__________________
beegees est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 01h19.


 
 
 
 
Partenaires

Hébergement Web