Bonjour a tous,

Voila quelques heures que je passe a essaye de trouver une solution pour passer un paramètre dans un modal fournit par un Template.

Voici ce que j'ai au niveau du Javascript :
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
(function($) {
 
$.modal = function (config) {
 
	var defaults, options, container, header, close, content, title, overlay;
 
	defaults = {
		 title: ''
		, html: ''
		, ajax: ''
		, width: null
		, overlay: true
		, overlayClose: false
		, escClose: true
	};
 
	options = $.extend (defaults, config);
 
	container = $('<div>', { id: 'modal' });
	header = $('<div>',  { id: 'modalHeader' });
	content = $('<div>', { id: 'modalContent' });
	overlay = $('<div>', { id: 'overlay' });
	title = $('<h2>', { text: options.title });
	close = $('<a>', { 'class': 'close', href: 'javascript:;', html: '&times' });
 
	container.appendTo ('body');
	header.appendTo (container);
	content.appendTo (container);
	if (options.overlay) {
		overlay.appendTo ('body');
	}
	title.prependTo (header);
	close.appendTo (header);
 
	if (options.ajax == '' && options.html == '') {
		title.text ('No Content');
	}
 
	if (options.ajax !== '') {
		content.html ('<div id="modalLoader"><img src="./img/ajax-loader.gif" /></div>');
		$.modal.reposition ();
		$.get (options.ajax, function (response) {
			content.html (response);
			$.modal.reposition ();
		});
	}
 
	if (options.html !== '') {
		content.html (options.html);
	}
 
	close.bind ('click', function (e) { 
		e.preventDefault (); 
		$.modal.close (); 		
	});
 
	if (options.overlayClose) {
		overlay.bind ('click', function (e) { $.modal.close (); });
	}
 
	if (options.escClose) {
		$(document).bind ('keyup.modal', function (e) {
			var key = e.which || e.keyCode;
 
			if (key == 27) {
				$.modal.close ();
			}			
		});
	}
 
	$.modal.reposition ();
}
 
$.modal.reposition = function () {
	var width = $('#modal').outerWidth ();		
	var centerOffset = width / 2;	
	$('#modal').css ({ 'left': '50%', 'top': $(window).scrollTop () + 75, 'margin-left': '-' + centerOffset + 'px' });
};
 
$.modal.close = function () {
	$('#modal').remove ();
	$('#overlay').remove ();
	$(document).unbind ('keyup.modal');
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
$('#exampleModal').live ('click', function (e) {
                    e.preventDefault ();
 
                    $.modal ({ 
                        title: 'Modal'
                        , ajax: 'modal.php'
                    });	
                });
Je ne m'y retrouve pas avec les paramètres de Jquery UI, j'ai l'impression que celui la a été modifie, comment puis je ajouter la possibilité de passer un paramètre?
Merci d'avance,

Flav34