IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

jQuery Discussion :

Débutant, UI Accordion, saccades sous IE8 et contours pointillés


Sujet :

jQuery

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 2
    Points : 2
    Points
    2
    Par défaut Débutant, UI Accordion, saccades sous IE8 et contours pointillés
    Bonjour,

    avec un comparse nous souhaitons mettre en place une liste dynamique à la place de l'actuelle liste brute sur notre site (http://www.unknown-island.com/wap-live).

    Pour ce faire nous avons choisi la fonction de jQuery Accordion.

    On a non sans mal réussi à virer le conteneur glossy pour ne laisser que la petite bannière mais dans un premier temps on s'est confrontés à un petit soucis (qui n'en est pas un si l'on en crois certains).

    1- Mon main browser étant Opera je n'ai pas vu de suite le problème mais sous pratiquement tous les autres navigateurs un contour en pointillés apparait. L'utilité de ce dernier ne m'est plus inconnue après avoir parcouru le web mais esthétiquement et compte tenu des visiteurs du site, cette fonction est inutile.
    On a quand même essayé une technique qui consistait à faire :
    a:hover { outline: 0 } mais ça ne changeait rien.

    2. Le second problème se situe sur IE principalement, mais je constate le même effet à une moindre mesure sur les autres navigateurs. Pour IE je parlerais de saccades pures et simples et pour les autres navigateurs je parlerais d'animation pas finie. Donc on recherche une astuce pour que ça passe sous IE voire la façon de modifier l'animation.

    L'adresse de la page de test : http://www.unknown-island.com/ajaxv2/acc.php

    Les fichiers :

    jquery.ui.accordion.js
    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
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    /*
     * jQuery UI Accordion 1.8
     *
     * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
     * Dual licensed under the MIT (MIT-LICENSE.txt)
     * and GPL (GPL-LICENSE.txt) licenses.
     *
     * http://docs.jquery.com/UI/Accordion
     *
     * Depends:
     *	jquery.ui.core.js
     *	jquery.ui.widget.js
     */
    (function($) {
     
    $.widget("ui.accordion", {
    	options: {
    		active: -1,
    		animated: 'slide',
    		autoHeight: false,
    		clearStyle: false,
    		collapsible: false,
    		event: "click",
    		fillSpace: false,
    		header: "> li > :first-child,> :not(li):even",
    		icons: {
    			header: "ui-icon-triangle-1-e",
    			headerSelected: "ui-icon-triangle-1-s"
    		},
    		navigation: false,
    		navigationFilter: function() {
    			return this.href.toLowerCase() == location.href.toLowerCase();
    		}
    	},
    	_create: function() {
     
    		var o = this.options, self = this;
    		this.running = 0;
     
    		this.element.addClass("ui-accordion ui-widget ui-helper-reset");
     
    		// in lack of child-selectors in CSS we need to mark top-LIs in a UL-accordion for some IE-fix
    		if (this.element[0].nodeName == "UL") {
    			this.element.children("li").addClass("ui-accordion-li-fix");
    		}
     
    		this.headers = this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
    			.bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); })
    			.bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); })
    			.bind("focus.accordion", function(){ $(this).addClass('ui-state-focus'); })
    			.bind("blur.accordion", function(){ $(this).removeClass('ui-state-focus'); });
     
    		this.headers
    			.next()
    				.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
     
    		if ( o.navigation ) {
    			var current = this.element.find("a").filter(o.navigationFilter);
    			if ( current.length ) {
    				var header = current.closest(".ui-accordion-header");
    				if ( header.length ) {
    					// anchor within header
    					this.active = header;
    				} else {
    					// anchor within content
    					this.active = current.closest(".ui-accordion-content").prev();
    				}
    			}
    		}
     
    		this.active = this._findActive(this.active || o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");
    		this.active.next().addClass('ui-accordion-content-active');
     
    		//Append icon elements
    		this._createIcons();
     
    		// IE7-/Win - Extra vertical space in lists fixed
    		if ($.browser.msie) {
    			this.element.find('a').css('zoom', '1');
    		}
     
    		this.resize();
     
    		//ARIA
    		this.element.attr('role','tablist');
     
    		this.headers
    			.attr('role','tab')
    			.bind('keydown', function(event) { return self._keydown(event); })
    			.next()
    			.attr('role','tabpanel');
     
    		this.headers
    			.not(this.active || "")
    			.attr('aria-expanded','false')
    			.attr("tabIndex", "-1")
    			.next()
    			.hide();
     
    		// make sure at least one header is in the tab order
    		if (!this.active.length) {
    			this.headers.eq(0).attr('tabIndex','0');
    		} else {
    			this.active
    				.attr('aria-expanded','true')
    				.attr('tabIndex', '0');
    		}
     
    		// only need links in taborder for Safari
    		if (!$.browser.safari)
    			this.headers.find('a').attr('tabIndex','-1');
     
    		if (o.event) {
    			this.headers.bind((o.event) + ".accordion", function(event) {
    				self._clickHandler.call(self, event, this);
    				event.preventDefault();
    			});
    		}
     
    	},
     
    	_createIcons: function() {
    		var o = this.options;
    		if (o.icons) {
    			$("<span/>").addClass("ui-icon " + o.icons.header).prependTo(this.headers);
    			this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);
    			this.element.addClass("ui-accordion-icons");
    		}
    	},
     
    	_destroyIcons: function() {
    		this.headers.children(".ui-icon").remove();
    		this.element.removeClass("ui-accordion-icons");
    	},
     
    	destroy: function() {
    		var o = this.options;
     
    		this.element
    			.removeClass("ui-accordion ui-widget ui-helper-reset")
    			.removeAttr("role")
    			.unbind('.accordion')
    			.removeData('accordion');
     
    		this.headers
    			.unbind(".accordion")
    			.removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
    			.removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");
     
    		this.headers.find("a").removeAttr("tabindex");
    		this._destroyIcons();
    		var contents = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");
    		if (o.autoHeight || o.fillHeight) {
    			contents.css("height", "");
    		}
     
    		return this;
    	},
     
    	_setOption: function(key, value) {
    		$.Widget.prototype._setOption.apply(this, arguments);
     
    		if (key == "active") {
    			this.activate(value);
    		}
    		if (key == "icons") {
    			this._destroyIcons();
    			if (value) {
    				this._createIcons();
    			}
    		}
     
    	},
     
    	_keydown: function(event) {
     
    		var o = this.options, keyCode = $.ui.keyCode;
     
    		if (o.disabled || event.altKey || event.ctrlKey)
    			return;
     
    		var length = this.headers.length;
    		var currentIndex = this.headers.index(event.target);
    		var toFocus = false;
     
    		switch(event.keyCode) {
    			case keyCode.RIGHT:
    			case keyCode.DOWN:
    				toFocus = this.headers[(currentIndex + 1) % length];
    				break;
    			case keyCode.LEFT:
    			case keyCode.UP:
    				toFocus = this.headers[(currentIndex - 1 + length) % length];
    				break;
    			case keyCode.SPACE:
    			case keyCode.ENTER:
    				this._clickHandler({ target: event.target }, event.target);
    				event.preventDefault();
    		}
     
    		if (toFocus) {
    			$(event.target).attr('tabIndex','-1');
    			$(toFocus).attr('tabIndex','0');
    			toFocus.focus();
    			return false;
    		}
     
    		return true;
     
    	},
     
    	resize: function() {
     
    		var o = this.options, maxHeight;
     
    		if (o.fillSpace) {
     
    			if($.browser.msie) { var defOverflow = this.element.parent().css('overflow'); this.element.parent().css('overflow', 'hidden'); }
    			maxHeight = this.element.parent().height();
    			if($.browser.msie) { this.element.parent().css('overflow', defOverflow); }
     
    			this.headers.each(function() {
    				maxHeight -= $(this).outerHeight(true);
    			});
     
    			this.headers.next().each(function() {
        		   $(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height()));
    			}).css('overflow', 'auto');
     
    		} else if ( o.autoHeight ) {
    			maxHeight = 0;
    			this.headers.next().each(function() {
    				maxHeight = Math.max(maxHeight, $(this).height());
    			}).height(maxHeight);
    		}
     
    		return this;
    	},
     
    	activate: function(index) {
    		// TODO this gets called on init, changing the option without an explicit call for that
    		this.options.active = index;
    		// call clickHandler with custom event
    		var active = this._findActive(index)[0];
    		this._clickHandler({ target: active }, active);
     
    		return this;
    	},
     
    	_findActive: function(selector) {
    		return selector
    			? typeof selector == "number"
    				? this.headers.filter(":eq(" + selector + ")")
    				: this.headers.not(this.headers.not(selector))
    			: selector === false
    				? $([])
    				: this.headers.filter(":eq(0)");
    	},
     
    	// TODO isn't event.target enough? why the seperate target argument?
    	_clickHandler: function(event, target) {
     
    		var o = this.options;
    		if (o.disabled)
    			return;
     
    		// called only when using activate(false) to close all parts programmatically
    		if (!event.target) {
    			if (!o.collapsible)
    				return;
    			this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
    				.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
    			this.active.next().addClass('ui-accordion-content-active');
    			var toHide = this.active.next(),
    				data = {
    					options: o,
    					newHeader: $([]),
    					oldHeader: o.active,
    					newContent: $([]),
    					oldContent: toHide
    				},
    				toShow = (this.active = $([]));
    			this._toggle(toShow, toHide, data);
    			return;
    		}
     
    		// get the click target
    		var clicked = $(event.currentTarget || target);
    		var clickedIsActive = clicked[0] == this.active[0];
     
    		// TODO the option is changed, is that correct?
    		// TODO if it is correct, shouldn't that happen after determining that the click is valid?
    		o.active = o.collapsible && clickedIsActive ? false : $('.ui-accordion-header', this.element).index(clicked);
     
    		// if animations are still active, or the active header is the target, ignore click
    		if (this.running || (!o.collapsible && clickedIsActive)) {
    			return;
    		}
     
    		// switch classes
    		this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
    			.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
    		if (!clickedIsActive) {
    			clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top")
    				.find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);
    			clicked.next().addClass('ui-accordion-content-active');
    		}
     
    		// find elements to show and hide
    		var toShow = clicked.next(),
    			toHide = this.active.next(),
    			data = {
    				options: o,
    				newHeader: clickedIsActive && o.collapsible ? $([]) : clicked,
    				oldHeader: this.active,
    				newContent: clickedIsActive && o.collapsible ? $([]) : toShow,
    				oldContent: toHide
    			},
    			down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
     
    		this.active = clickedIsActive ? $([]) : clicked;
    		this._toggle(toShow, toHide, data, clickedIsActive, down);
     
    		return;
     
    	},
     
    	_toggle: function(toShow, toHide, data, clickedIsActive, down) {
     
    		var o = this.options, self = this;
     
    		this.toShow = toShow;
    		this.toHide = toHide;
    		this.data = data;
     
    		var complete = function() { if(!self) return; return self._completed.apply(self, arguments); };
     
    		// trigger changestart event
    		this._trigger("changestart", null, this.data);
     
    		// count elements to animate
    		this.running = toHide.size() === 0 ? toShow.size() : toHide.size();
     
    		if (o.animated) {
     
    			var animOptions = {};
     
    			if ( o.collapsible && clickedIsActive ) {
    				animOptions = {
    					toShow: $([]),
    					toHide: toHide,
    					complete: complete,
    					down: down,
    					autoHeight: o.autoHeight || o.fillSpace
    				};
    			} else {
    				animOptions = {
    					toShow: toShow,
    					toHide: toHide,
    					complete: complete,
    					down: down,
    					autoHeight: o.autoHeight || o.fillSpace
    				};
    			}
     
    			if (!o.proxied) {
    				o.proxied = o.animated;
    			}
     
    			if (!o.proxiedDuration) {
    				o.proxiedDuration = o.duration;
    			}
     
    			o.animated = $.isFunction(o.proxied) ?
    				o.proxied(animOptions) : o.proxied;
     
    			o.duration = $.isFunction(o.proxiedDuration) ?
    				o.proxiedDuration(animOptions) : o.proxiedDuration;
     
    			var animations = $.ui.accordion.animations,
    				duration = o.duration,
    				easing = o.animated;
     
    			if (easing && !animations[easing] && !$.easing[easing]) {
    				easing = 'slide';
    			}
    			if (!animations[easing]) {
    				animations[easing] = function(options) {
    					this.slide(options, {
    						easing: easing,
    						duration: duration || 700
    					});
    				};
    			}
     
    			animations[easing](animOptions);
     
    		} else {
     
    			if (o.collapsible && clickedIsActive) {
    				toShow.toggle();
    			} else {
    				toHide.hide();
    				toShow.show();
    			}
     
    			complete(true);
     
    		}
     
    		// TODO assert that the blur and focus triggers are really necessary, remove otherwise
    		toHide.prev().attr('aria-expanded','false').attr("tabIndex", "-1").blur();
    		toShow.prev().attr('aria-expanded','true').attr("tabIndex", "0").focus();
     
    	},
     
    	_completed: function(cancel) {
     
    		var o = this.options;
     
    		this.running = cancel ? 0 : --this.running;
    		if (this.running) return;
     
    		if (o.clearStyle) {
    			this.toShow.add(this.toHide).css({
    				height: "",
    				overflow: ""
    			});
    		}
     
    		// other classes are removed before the animation; this one needs to stay until completed
    		this.toHide.removeClass("ui-accordion-content-active");
     
    		this._trigger('change', null, this.data);
    	}
     
    });
     
     
    $.extend($.ui.accordion, {
    	version: "1.8",
    	animations: {
    		slide: function(options, additions) {
    			options = $.extend({
    				easing: "swing",
    				duration: 300
    			}, options, additions);
    			if ( !options.toHide.size() ) {
    				options.toShow.animate({height: "show"}, options);
    				return;
    			}
    			if ( !options.toShow.size() ) {
    				options.toHide.animate({height: "hide"}, options);
    				return;
    			}
    			var overflow = options.toShow.css('overflow'),
    				percentDone = 0,
    				showProps = {},
    				hideProps = {},
    				fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
    				originalWidth;
    			// fix width before calculating height of hidden element
    			var s = options.toShow;
    			originalWidth = s[0].style.width;
    			s.width( parseInt(s.parent().width(),10) - parseInt(s.css("paddingLeft"),10) - parseInt(s.css("paddingRight"),10) - (parseInt(s.css("borderLeftWidth"),10) || 0) - (parseInt(s.css("borderRightWidth"),10) || 0) );
     
    			$.each(fxAttrs, function(i, prop) {
    				hideProps[prop] = 'hide';
     
    				var parts = ('' + $.css(options.toShow[0], prop)).match(/^([\d+-.]+)(.*)$/);
    				showProps[prop] = {
    					value: parts[1],
    					unit: parts[2] || 'px'
    				};
    			});
    			options.toShow.css({ height: 0, overflow: 'hidden' }).show();
    			options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{
    				step: function(now, settings) {
    					// only calculate the percent when animating height
    					// IE gets very inconsistent results when animating elements
    					// with small values, which is common for padding
    					if (settings.prop == 'height') {
    						percentDone = ( settings.end - settings.start === 0 ) ? 0 :
    							(settings.now - settings.start) / (settings.end - settings.start);
    					}
     
    					options.toShow[0].style[settings.prop] =
    						(percentDone * showProps[settings.prop].value) + showProps[settings.prop].unit;
    				},
    				duration: options.duration,
    				easing: options.easing,
    				complete: function() {
    					if ( !options.autoHeight ) {
    						options.toShow.css("height", "");
    					}
    					options.toShow.css("width", originalWidth);
    					options.toShow.css({overflow: overflow});
    					options.complete();
    				}
    			});
    		},
    		bounceslide: function(options) {
    			this.slide(options, {
    				easing: options.down ? "easeOutBounce" : "swing",
    				duration: options.down ? 1000 : 200
    			});
    		}
    	}
    });
     
    })(jQuery);
    Code source de la page
    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
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    <html>
    <head>
    	<meta charset="UTF-8" />
    	<title>WAP Live</title>
     
    	<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
    	<script type="text/javascript" src="js/jquery.ui.core.js"></script>
    	<script type="text/javascript" src="js/jquery.ui.widget.js"></script>
    	<script type="text/javascript" src="js/jquery.ui.accordion.js"></script>
    	<link type="text/css" href="design.css" rel="stylesheet" />
    	<link rel="icon" type="image/png" href="images/favicon.png" />
    	<script type="text/javascript">
    	$(function() {
    		$("#accordion").accordion({
    			collapsible: true
    		});
    	});
     
    	</script>
    </head>
    <body>
     
     
     
    <div class="demo">
     
    <div id="accordion" style="width: 850px;">
     
     
    <h3><a href="#"><img src="images/icones_jeu/Blur.png"></a></h3><div ><table cellpadding="2" cellspacing="1" class="tableau2">
       <tr>
           <td style="width: 200px;" class="td3">25 Avril 2010 &agrave; 21:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">1/3 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=23">Voir</a></td>
       </tr></table></div><h3><a href="#"><img src="images/icones_jeu/Call of Duty 4.png"></a></h3><div ><table cellpadding="2" cellspacing="1" class="tableau2">
       <tr>
           <td style="width: 200px;" class="td3">24 Avril 2010 &agrave; 21:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">1/3 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=22">Voir</a></td>
       </tr></table></div><h3><a href="#"><img src="images/icones_jeu/FIFA 10.png"></a></h3><div ><table cellpadding="2" cellspacing="1" class="tableau2">
       <tr>
           <td style="width: 200px;" class="td3">25 Avril 2010 &agrave; 22:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">1/4 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=19">Voir</a></td>
       </tr>
       <tr>
           <td style="width: 200px;" class="td3">28 Avril 2010 &agrave; 21:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Playstation 3.png"></td><td style="width: 145px;" class="td3">1/4 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=15">Voir</a></td>
       </tr>
       <tr>
           <td style="width: 200px;" class="td3">30 Avril 2010 &agrave; 22:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">1/3 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=13">Voir</a></td>
       </tr></table></div><h3><a href="#"><img src="images/icones_jeu/PES 2010.png"></a></h3><div ><table cellpadding="2" cellspacing="1" class="tableau2">
       <tr>
           <td style="width: 200px;" class="td3">27 Avril 2010 &agrave; 23:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">1/5 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=14">Voir</a></td>
       </tr></table></div><h3><a href="#"><img src="images/icones_jeu/Red Dead Redemption.png"></a></h3><div ><table cellpadding="2" cellspacing="1" class="tableau2">
       <tr>
           <td style="width: 200px;" class="td3">28 Avril 2010 &agrave; 23:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">1/5 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=17">Voir</a></td>
       </tr></table></div><h3><a href="#"><img src="images/icones_jeu/Street Fighter IV.png"></a></h3><div ><table cellpadding="2" cellspacing="1" class="tableau2">
       <tr>
           <td style="width: 200px;" class="td3">22 Avril 2010 &agrave; 23:40</td>
           <td style="width: 365px;" class="td3">Ca teste</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Playstation 3.png"></td><td style="width: 145px;" class="td3">1/4 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=20">Voir</a></td>
       </tr>
       <tr>
           <td style="width: 200px;" class="td3">25 Avril 2010 &agrave; 17:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Playstation 3.png"></td><td style="width: 145px;" class="td3">1/3 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=18">Voir</a></td>
       </tr></table></div><h3><a href="#"><img src="images/icones_jeu/Super Street Fighter IV.png"></a></h3><div ><table cellpadding="2" cellspacing="1" class="tableau2">
       <tr>
           <td style="width: 200px;" class="td3">24 Avril 2010 &agrave; 23:00</td>
           <td style="width: 365px;" class="td3">test</td>
    	   <td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">1/3 participants</td>
    	   <td style="width: 46px;" class="td3"><a href="events.php?id=21">Voir</a></td>
       </tr></table></div>	
    </div>
     
    </div>
    </body>
    </html>
    En vous remerciant par avance.

  2. #2
    Rédacteur

    Avatar de danielhagnoul
    Homme Profil pro
    Étudiant perpétuel
    Inscrit en
    Février 2009
    Messages
    6 389
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 73
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant perpétuel
    Secteur : Enseignement

    Informations forums :
    Inscription : Février 2009
    Messages : 6 389
    Points : 22 933
    Points
    22 933
    Billets dans le blog
    125
    Par défaut
    Bonsoir.

    Vous dévoyez complètement UI Accordion de son usage normal, il n'est donc pas étonnant que cela vous crée des problèmes, surtout avec les CSS UI.

    UI Accordion affiche pourtant très bien vos tables, exemple :
    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
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    <!doctype html>
    <html lang="fr">
    <head>
    	<meta charset="utf-8">
    	<meta name="Author" content="Daniel Hagnoul">
    	<meta name="description" content="Page type">
    	<title>Page type</title>
    	<link rel="stylesheet" type="text/css" href="../lib/jqueryui-1.8/css/humanity/jquery-ui-1.8.custom.css">	
    	<style>
    		/* BASE */
    		body {
    			background-color:#dcdcdc;
    			color:#000000;
    			font-family:sans-serif;
    			font-size:medium;
    			font-style:normal;
    			font-weight:normal;
    			line-height:normal;
    			letter-spacing:normal;
    		}
    		h1,h2,h3,h4,h5 {
    			font-family:serif;
    		}
    		div,p,h1,h2,h3,h4,h5,h6,ul,ol,dl,form,table,img {
    			margin:0px;
    			padding:0px;
    		}
    		p {
    			padding:6px;
    		}
    		ul,ol,dl {
    			list-style:none;
    			padding-left:6px;
    			padding-top:6px;
    		}
    		li {
    			padding-bottom:6px;
    		}
    		div#conteneur {
    			width:95%;
    			margin:12px auto;
    			padding:6px;
    			background-color:#FFFFFF;
    			color:#000000;
    			border:1px solid #666666;
    			font-size:0.8em;
    		}		
    		div#affiche {
    			margin:12px;
    			padding:6px;
    			border:1px solid #999999;
    			background-color:#FFFFFF;
    			color:#000000;
    		}
    		/* TEST */
    		.tableau2 {
    			margin-left:auto;
    			margin-right:auto;
    			text-align: center;
    			height: 10px;
    		}
    		.td3 {
    			height: 10px;
    			border:1px solid grey;
    			padding: 1px;
    		}
    	</style>
    	<script charset="utf-8" src="../lib/jqueryui-1.8/js/jquery-1.4.2.min.js"></script>
    	<script charset="utf-8" src="../lib/jqueryui-1.8/js/jquery-ui-1.8.custom.min.js"></script>
     	<script>
    		$(function(){
    			$("#accordion").accordion({
    				collapsible: true
    			});
    		});
    	</script>
    </head>
    <body>
    	<div id="conteneur">
     
    		<div id="accordion" style="width: 850px;">
    			<h3>
    				<a href="#">Titre 1</a>
    			</h3>
    			<div>
    				<table cellpadding="2" cellspacing="1" class="tableau2">
    					<tr>
    						<td style="width: 200px;" class="td3">2010 Avril 25 &agrave; 00:00</td>
    						<td style="width: 365px;" class="td3">baston du pacifique</td>
    						<td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">1/16 participants</td>
    						<td style="width: 46px;" class="td3"><a href="events.php?id=42">Voir</a></td>
    					</tr>
    					<tr>
    						<td style="width: 200px;" class="td3">2010 Mai 08 &agrave; 00:00</td>
    						<td style="width: 365px;" class="td3">mamie</td>
    						<td style="width: 110px;" class="td3"><img src="images/Playstation 3.png"></td><td style="width: 145px;" class="td3">1/24 participants</td>
    						<td style="width: 46px;" class="td3"><a href="events.php?id=51">Voir</a></td>
     
    					</tr>
    				</table>
    			</div>
    			<h3>
    				<a href="#">Titre 2</a>
    			</h3>
    			<div>
    				<table cellpadding="2" cellspacing="1" class="tableau2">
    					<tr>
    						<td style="width: 200px;" class="td3">2010 Avril 30 &agrave; 23:00</td>
    						<td style="width: 365px;" class="td3">Venez tester!</td>
    						<td style="width: 110px;" class="td3"><img src="images/Xbox 360.png"></td><td style="width: 145px;" class="td3">2/99 participants</td>
    						<td style="width: 46px;" class="td3"><a href="events.php?id=55">Voir</a></td>
    					</tr>
    					<tr>
    						<td style="width: 200px;" class="td3">2010 Mai 08 &agrave; 00:00</td>
    						<td style="width: 365px;" class="td3">Coupe du Monde 1943</td>
    						<td style="width: 110px;" class="td3"><img src="images/Playstation 3.png"></td><td style="width: 145px;" class="td3">1/32 participants</td>
    						<td style="width: 46px;" class="td3"><a href="events.php?id=54">Voir</a></td>
    					</tr>
    				</table>
    			</div>	
    		</div>
     
    	</div>
    </body>  
    </html>
    Si l'aspect normal de UI Accordion ne vous convient pas, je pense qu'un changement de conception de votre page web s'impose, en faveur de slideToggle peut-être.

    Blog

    Sans l'analyse et la conception, la programmation est l'art d'ajouter des bogues à un fichier texte vide.
    (Louis Srygley : Without requirements or design, programming is the art of adding bugs to an empty text file.)

  3. #3
    Candidat au Club
    Profil pro
    Inscrit en
    Avril 2010
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2010
    Messages : 2
    Points : 2
    Points
    2
    Par défaut
    Merci pour votre réponse.

    Effectivement, nous aurions dû nous douter que tout ce bricolage causerait des soucis. Etant donné notre faible niveau dans ce domaine nous n'avions pas cherché le moyen de réaliser cet "accordéon" ailleurs.

    slideToggle me paraît très bien, nous l'avons un peu testé et demain nous essayerons de l'intégrer au site.

    C'est vrai que ce genre de petit script est bien plus propre que l'usine à gaz que nous avions entreprit de faire fonctionner.

    Merci à vous.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Débutant] Compiler glu.h sous Code::Blocks
    Par allanp8 dans le forum OpenGL
    Réponses: 10
    Dernier message: 18/11/2007, 00h56
  2. [Débutant]Utilisation de RAPI sous Delphi
    Par Hokagge dans le forum API, COM et SDKs
    Réponses: 3
    Dernier message: 11/01/2006, 09h21
  3. [débutant]composantes dans une sous-fenêtre
    Par ulyssed dans le forum Interfaces Graphiques en Java
    Réponses: 6
    Dernier message: 01/03/2005, 09h03
  4. [Débutant] Problème d'installation sous Windows 2000
    Par bavmorda dans le forum PostgreSQL
    Réponses: 5
    Dernier message: 04/08/2004, 16h28
  5. [Débutant] Lancer une interface sous éclipse
    Par bonnefr dans le forum SWT/JFace
    Réponses: 11
    Dernier message: 11/05/2004, 15h59

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo