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

Mise en page CSS Discussion :

Décalage du body lors d'un clic sur une image (Fancybox)


Sujet :

CSS

  1. #1
    Membre habitué
    Homme Profil pro
    Webdesigner
    Inscrit en
    Août 2014
    Messages
    445
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Webdesigner
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Août 2014
    Messages : 445
    Points : 138
    Points
    138
    Par défaut Décalage du body lors d'un clic sur une image (Fancybox)
    Bonjour à tous,
    Me voici de retour avec un problème (basique) dont, malgré de nombreuses recherches et de visites sur les forums ayant traité (et résolu) ce sujet (dont développez.com), je n'arrive à trouver la solution.
    Lors d'un clic sur une vignette d'une galerie Fancybox, le body bouge de qq pixels lors de l'ouverture de l'image. Lors de sa fermeture, le body se "remet à sa place d'origine".
    Une petite vidéo pour vous montrer l'horreur :
    youtube;WyLtNcZLvFY]https://www.youtube.com/watch?v=WyLtNcZLvFY
    Il est dit partout que les CSS sont en cause (border, width:100%, margin etc...). Je les ai modifier maintes fois... sans résultat
    Actuellement, mes CSS sont les suivantes (j'ai laissé volontairement les [disabled] ) :
    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
    body {
    	/* [disabled]max-width: 100%; */
    	/* [disabled]margin: auto; */
    	/* [disabled]width: 100%; */
    	/* [disabled]height: auto; */
    	text-align: center;
    	/* [disabled]padding: 0px; */
    }
    a img{
    border:none;
    }
    #main {
    	/* [disabled]width: 100%; */
    	text-align: center;
    	float: none;
    	clear: none;
    	height: auto;
    	top: 100%;
    	position: absolute;
    	background-color: #FFFFFF;
    	left: 0px;
    	right: 0px;
    }
    h1 {
        color:#069;	
    }
    h3 {
    	color: #66FF33;
    	font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif;
    }
    	#filters {
    	background-color: #CC3333;
    	position: relative;
    	margin-top: 40px;
    }
    ul {
    	display: table;
    	margin: 1em auto;
    	/* [disabled]padding: 0; */
    	list-style: none;
    	text-align: center;
    	/* [disabled]width: 100%; */
    }
    /*---- button ----*/
    .button {
    	display: inline;
    	line-height: 2em;
    	background: #EEE;
    	text-shadow: none;
    	cursor: pointer;
    	width: 1120px;
    	text-align: center;
    	font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif;
    	height: auto;
    	margin-bottom: 0px;
    	margin-top: 0px;
    	/* [disabled]padding-left: 10px; */
    	/* [disabled]padding-right: 10px; */
    	position: relative;
    	/* [disabled]top: 0px; */
    }
    /*-- effet sur bouton --*/
    .button:hover {
        background-color:#8CF;
        text-shadow:none;
    }
    .button:active,.button.is-checked {
        background-color:#28F;
    }
    .button.is-checked {
    	color: white;
    	text-shadow: none;
    	font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif;
    }
    .button:active {
        box-shadow: none;
    }
    /*---- conteneur isotope ----*/
    .isotope {
    	/* [disabled]float: left; */
    	position: relative;
    	/* [disabled]top: -10px; */
    	left: auto;
    	right: auto;
    	text-align: center;
    	height: auto;
    	width: 1120px;
    	/* [disabled]margin-bottom: auto; */
    	/* [disabled]margin-left: auto; */
    	/* [disabled]margin-right: auto; */
    }
    /* ---- .vignette ---- */
    .vignette {
    	position: relative;
    	float: left;
    	display: block;
    	overflow: hidden;
    	height: 175px;
    	width: 270px;
    	border: 5px solid transparent;
    	text-align: center;
    	/* [disabled]padding: 0; */
    	margin-bottom: 0;
    	/* [disabled]margin-left: auto; */
    	/* [disabled]margin-right: auto; */
    	margin-top: 0;
    }
    .vignette span{  /* concerne le texte à afficher */
    	position: absolute;
    	display: block;
    	transition: all 0.4s ease-in-out;
    	background: rgba(0, 0, 255, 0.5);
    	width: 100%;
    	height: 175px;
    	bottom: -100%;   /* rend invisible le texte */
    	/* [disabled]left: 0; */
    	color: #FF0066;
    	text-align: center;
    	font: normal 20px/20px Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif;
    	vertical-align: super;
    }
    .vignette:hover span{
    	bottom: 0%;   /* rend visible le texte */
    }
    .fancybox-custom .fancybox-skin {
    	box-shadow: 0 0 50px #;
    		}
    #diaporama {
    	overflow: hidden;
    	-webkit-box-shadow: 0px 0px;
    	box-shadow: 0px 0px;
    	height: auto;
    	margin: 0px auto;
    	/* [disabled]left: auto; */
    	/* [disabled]right: auto; */
    	float: none;
    }
    #entete {
    	/* [disabled]width: 100%; */
    	/* [disabled]height: 100%; */
    	margin: 0px;
    	/* [disabled]padding: 0px; */
    }
    #img2 {
    	width: 100%;
    	height: auto;
    }
     
    #logo {
    	margin-top: 2%;
    	position: relative;
    	margin-left: 2%;
    	margin-right: auto;
    	width: 80%;
    	text-align: left;
    	float: left;
    }
    .logo {
    	width: 20%;
    	margin-left: auto;
    	margin-right: auto;
    }
    .titre_un {
    	text-shadow: 0px 0px;
    	/* [disabled]text-align: center; */
    	color: #FFFFFF;
    	border-spacing: 0px 0px;
    	border-collapse: collapse;
    	position: static;
    	font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif;
    }
    h1 {
    	font-size: 20%;
    }
    .portrait {
    	width: 50%;
    }	
    h1,h2,h3,h4,h5,h6 {
    	font-size: 100%;
    	font-weight: normal;
    	vertical-align: 40px;
    }
     
    /*------ menu -------*/
    .logo_menu {
    	width: 80px;
    	margin-left: 0px;
    	left: 0px;
    	text-align: left;
    	position: absolute;
    }
    #menu {
    	margin-left: auto;
    	margin-right: auto;
    	width: 100%;
    	text-align: center;
    	background-color: #CC3333;
    	height: 40px;
    	z-index: 1000;
    }
    #menu>a {
    	padding: 10px 15px;
    	font-family: 'PT Sans', sans-serif;
    	color: #000;
    	background-color: #c03;
    	text-align: center;
    	/* [disabled]width: 100%; */
    	margin-left: 0px;
    	margin-right: 0px;
    	line-height: 40px;
    	margin-bottom: 40px;
    }
    #menu>a:hover {
    	background-color: rgba(0, 0, 0, 0.1);
    	color: #fff;
    	text-align: center;
    	margin-left: 0px;
    	margin-right: 0px;
    	/* [disabled]width: 100%; */
    }
    #menu>a.selected {
    	background-color: rgba(0, 0, 0, 0.1);
    	color: #fff;
    	text-align: center;
    	margin-left: 0px;
    	margin-right: 0px;
    	/* [disabled]width: 100%; */
    }
    header.headermobile {
    	position: fixed;
    	top: 0px;
    	width: 100%;
    	height: auto;
    	margin: 0px auto 20px auto;
    	padding: 0px;
    	z-index: 10000;
    	display: none;
    }
     
    		header.headermobile h1 {
    			font-weight: 300;
    			text-align: center;
    			font-size: 2em;
    			margin-top: 10px;
    		}
     
    		header.headermobile button {
    			position: absolute;
    			float: left;
    			display: block;
    			width: 40px;
    			height: 40px;
    			border: none;
    			cursor: pointer;
    			margin: 10px 10px 0px 10px;
    		}
     
     
    				.menumobile a {
    	display: block;
    	text-transform: uppercase;
    	font-size: 1.2em;
    	font-weight: 300;
    	width: 100%;
    	text-align: center;
    	padding: 1em;
    	background-color: #660066;															
    				}
    								.menumobile a: hover {
    	display: block;
    	text-transform: none;
    	font-size: 1em;
    	font-weight: 300;
    	width: 100%;
    	text-align: center;
    	padding: 1em;
    	background-color: #FF0066;															
    				}
     
     
    /*----- ombre image -------*/
    .image-ombre {
    	height: auto;
    	/* [disabled]width: 100%; */
    	/* [disabled]padding: 0px; */
    	margin-bottom: 0px;
    	/* [disabled]margin-left: 0px; */
    	/* [disabled]margin-right: 0px; */
    	/* [disabled]margin-top: 50px; */
    }
    #img1 {
    	/* [disabled]width: 100%; */
    	padding-bottom: 0px;
    	padding-left: 0px;
    	padding-right: 0px;
    	/* [disabled]margin-bottom: 20px; */
    	margin-left: 0px;
    	margin-right: 0px;
    	/* [disabled]margin-top: 40px; */
    }
    #img2 {
    	/* [disabled]width: 100%; */
    	height: auto;
    	margin: 0px;
    	/* [disabled]padding-bottom: 0px; */
    	/* [disabled]padding-left: 0px; */
    	/* [disabled]padding-right: 0px; */
    	/* [disabled]padding-top: 40px; */
    }
    #img3 {
    	/* [disabled]width: 100%; */
    	background-image: url(../LDDC/img/dummy-640x310-2.jpg);
    	color: #FFFFFF;
    }
    #img5 {
    	background-position: center center;
    	background-size: cover;
    	background-attachment: scroll;
    	/* [disabled]width: 100%; */
    	/* [disabled]height: 800px; */
    	margin-bottom: 0px;
    	margin-left: 0px;
    	margin-right: 0px;
    	/* [disabled]padding-bottom: 0px; */
    	/* [disabled]padding-left: 0px; */
    	/* [disabled]padding-right: 0px; */
    	border-top: 80px solid #CC0033;
    }
    #img6 {
    	background-image: url(../LDDC/img/dummy-640x310-3.jpg);
    	background-position: center top;
    	background-size: cover;
    	background-repeat: no-repeat;
    	background-attachment: fixed;
    	/* [disabled]width: 100%; */
    	/* [disabled]height: 800px; */
    	border-top-width: 40px;
    	border-bottom-width: 40px;
    	border-color: #FFFFFF;
    	border-top-style: solid;
    	border-bottom-style: solid;
    }
     
    #espace-bas {
    	height: 240px;
    	width: 100%;
    	background-color: #990033;
    }
    	#footer {
    	width: 100%;
    	height: 80px;
    	background-color: #FF0033;
    	/* [disabled]bottom: 0px; */
    	/* [disabled]left: 0px; */
    	/* [disabled]right: 0px; */
    	padding-bottom: 0px;
    	/* [disabled]padding-left: 0px; */
    	padding-right: 0px;
    	/* [disabled]margin-bottom: 0px; */
    	/* [disabled]margin-left: 0px; */
    }
    /* TABLETS */
    @media screen and (max-width: 1020px ) {
     
    	/* SMARTPHONES */
    @media screen and (max-width: 767px) {
    	#entete {
    	/* [disabled]width: 100%; */
    	/* [disabled]height: 100%; */
    	display: none;
    }	
    #menu {
            display: none;
    }
        header.headermobile  {
            display: block;
    		}
    #main {
    	text-align: center;
    	float: none;
    	clear: none;
    	height: auto;
    	top: 0px;
    	position: absolute;
    	background-color: #FFFFFF;
    	left: 0px;
    	right: 0px;
    	margin-left: auto;
    	margin-right: auto;
    }
    .isotope {
    	/* [disabled]float: left; */
    	margin: 0px auto auto;
    	position: relative;
    	top: 0px;
    	left: auto;
    	right: auto;
    	text-align: center;
    	height: auto;
    	width: 572px;
    }
    }
    et les CSS de Fancybox :
    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
    /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
    .fancybox-wrap,
    .fancybox-skin,
    .fancybox-outer,
    .fancybox-inner,
    .fancybox-image,
    .fancybox-wrap iframe,
    .fancybox-wrap object,
    .fancybox-nav,
    .fancybox-nav span,
    .fancybox-tmp
    {
    	padding: 0;
    	margin: 0;
    	border: 0;
    	outline: none;
    	vertical-align: top;
    }
     
    .fancybox-image, .fancybox-iframe {
    	display: block;
    	width: 100%;
    	height: 100%;
    }
     
    .fancybox-image {
    	max-width: 100%;
    	max-height: 100%;
    }
     
    #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
    	background-image: url('fancybox_sprite.png');
    }
     
    #fancybox-loading {
    	position: fixed;
    	top: 50%;
    	left: 50%;
    	margin-top: -22px;
    	margin-left: -22px;
    	background-position: 0 -108px;
    	cursor: pointer;
    	z-index: 8060;
    	background-color: #000000;
    }
     
    #fancybox-loading div {
    	width: 44px;
    	height: 44px;
    	background: url('fancybox_loading.gif') center center no-repeat;
    }
     
    .fancybox-close {
    	position: absolute;
    	top: 0px;
    	right: 0px;
    	width: 36px;
    	height: 36px;
    	cursor: pointer;
    	z-index: 8040;
    }
     
    .fancybox-nav {
    	position: absolute;
    	top: 0;
    	width: 40%;
    	height: 100%;
    	cursor: pointer;
    	text-decoration: none;
    	z-index: 8040;
    }
     
    .fancybox-prev {
    	left: 0;
    }
     
    .fancybox-next {
    	right: 0;
    }
     
    .fancybox-nav span {
    	position: absolute;
    	top: 50%;
    	width: 36px;
    	height: 34px;
    	margin-top: 0px;
    	cursor: pointer;
    	z-index: 8040;
    	visibility: hidden;
    }
     
    .fancybox-prev span {
    	left: 0px;
    	background-position: 0 -36px;
    }
     
    .fancybox-next span {
    	right: 0px;
    	background-position: 0 -72px;
    }
     
    .fancybox-nav:hover span {
    	visibility: visible;
    }
     
    .fancybox-tmp {
    	position: absolute;
    	top: -99999px;
    	left: -99999px;
    	visibility: hidden;
    	max-width: 99999px;
    	max-height: 99999px;
    	overflow: visible !important;
    }
     
    /* Overlay helper */
     
    .fancybox-lock {
        overflow: hidden !important;
        width: auto;
    }
     
    .fancybox-lock body {
        overflow: hidden !important;
    }
     
    .fancybox-lock-test {
        overflow-y: hidden !important;
    }
     
    .fancybox-overlay {
    	position: absolute;
    	top: 0;
    	left: 0;
    	overflow: hidden;
    	display: none;
    	z-index: 8010;
    	background: url('fancybox_overlay.png');
    }
     
    .fancybox-overlay-fixed {
    	position: fixed;
    	bottom: 0;
    	right: 0;
    }
     
    .fancybox-lock .fancybox-overlay {
    	overflow: auto;
    	overflow-y: scroll;
    }
     
    /* Title helper */
     
    .fancybox-title {
    	visibility: hidden;
    	font: normal 16px "Helvetica Neue",Helvetica,Arial,sans-serif;
    	position: relative;
    	text-shadow: none;
    	z-index: 8050;
    }
     
    .fancybox-opened .fancybox-title {
    	visibility: visible;
    }
     
    .fancybox-title-float-wrap {
    	position: absolute;
    	bottom: 0;
    	right: 50%;
    	margin-bottom: -20px;
    	z-index: 8050;
    	text-align: center;
    }
     
    .fancybox-title-float-wrap .child {
    	display: inline-block;
    	margin-right: -100%;
    	padding: 2px 20px;
    	background: transparent; /* Fallback for web browsers that doesn't support RGBa */
    	color: #FFF;
    	font-weight: bold;
    	line-height: 32px;
    	white-space: nowrap;
    }
     
    .fancybox-title-outside-wrap {
    	position: relative;
    	margin-top: 10px;
    	color: #fff;
    }
     
    .fancybox-title-inside-wrap {
    	padding-top: 10px;
    }
     
    .fancybox-title-over-wrap {
    	position: absolute;
    	bottom: 0;
    	left: 0;
    	color: #fff;
    	padding: 10px;
    	background: #000000;
    }
     
    /*Retina graphics!*/
    @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
    	   only screen and (min--moz-device-pixel-ratio: 1.5),
    	   only screen and (min-device-pixel-ratio: 1.5){
     
    	#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
    		background-image: url('fancybox_sprite@2x.png');
    		background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
    	}
     
    	#fancybox-loading div {
    		background-image: url('fancybox_loading@2x.gif');
    		background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
    	}
    }
    Le problème peut-il venir d'ailleurs ?
    Merci pour votre aide et bonne fin de week-end,
    dh


  2. #2
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 108
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 108
    Points : 44 921
    Points
    44 921
    Par défaut
    Bonjour,
    il me semble que l'on te la déjà dit la vidéo est bien moins efficace que du code ou une page en ligne, néanmoins je me hasarde à une réponse, ajoute sur le body le CSS suivant overflow-y:scroll.

  3. #3
    Membre habitué
    Homme Profil pro
    Webdesigner
    Inscrit en
    Août 2014
    Messages
    445
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Webdesigner
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Août 2014
    Messages : 445
    Points : 138
    Points
    138
    Par défaut
    Bonsoir NoSmoking,
    J'ai déjà tenté le Pour ce qui est des vidéos, mettre ma page en ligne c'est comme si je faisais rentrer quelqu'un chez moi, dans un appart bordélique comme ce n'est pas permis, où le ménage n'a pas été fait depuis des mois :p (juste à titre comparatif. C'est rangé chez moi Pour ce qui est de ma page, on va dire que je gabarise. J'attends pour mettre des photos HD et tout styler (d'où bcp de fautes de goût)
    Afin de ne pas me faire jeter des cailloux, j'ai limité mon html au strict minimum (mais toutes les CSS sont présentes). http://pasterencemaisbud.fr/decalage/index.html
    Je m'arrache les cheveux, j'ai bcp cherché avant de relancer une discussion
    As-tu une idée ?
    Bonne soirée,
    dh

  4. #4
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 108
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 108
    Points : 44 921
    Points
    44 921
    Par défaut
    Tu as bien un problème de débordement d'un élément qui fait apparaître/disparaître les scrollbars.

    Fais le test avec un
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    body {
      overflow:hidden;
    }

  5. #5
    Membre habitué
    Homme Profil pro
    Webdesigner
    Inscrit en
    Août 2014
    Messages
    445
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Webdesigner
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Août 2014
    Messages : 445
    Points : 138
    Points
    138
    Par défaut
    Bonsoir NoSmoking,
    Merci pour ta réponse. J'ai oublié de dire dans mon message que j'avais aussi essayé le overflow:hidden sur le body. Avec ce code, plus de décalage mais ma page est un site "one page" et donc le scroll vertical y est indispensable.
    Je ne comprends pas, j'ai vérifier X fois les CSS. J'ai déjà eu ce problème (uniquement sur IE, de mémoire) résolu grâce à "Développez.com" (et NoSmoking je crois , un border:none avait suffit à résoudre ce problème.
    Là, je pense avoir tout checké à maintes reprises Sur les forums, la scrollbar est souvent accusée de ce décalage, mais là, dans mon exemple, comment une scrollbar peut exister (même si apparemment c'est le cas) ?
    Comment avec si peu de html, le prob peut-il persister ? Déprimant
    Merci pour ton message et pour ton aide.
    Bonne soirée,
    dh

  6. #6
    Invité
    Invité(e)
    Par défaut
    Bonjour,
    c'est bien l'apparition/disparition de la barre de scroll qui crée le décalage.

    J'ai résolu en faisant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    body {
        overflow-y: auto; /* valeur par défaut -> peut etre supprimé */
        text-align: center;
    }
    et en SUPPRIMANT :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    .fancybox-lock body {
        overflow: hidden !important;
    }
    Ou, comme c'est dans un fichier CSS non modifiable, AJOUTER au CSS :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    .fancybox-lock body {
        overflow: auto;
    }

  7. #7
    Membre habitué
    Homme Profil pro
    Webdesigner
    Inscrit en
    Août 2014
    Messages
    445
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Webdesigner
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Août 2014
    Messages : 445
    Points : 138
    Points
    138
    Par défaut
    Bonsoir jreaux62,
    Merci pour ton message.
    Plus ça va, moins je comprends ça fonctionne sur la "page" envoyée hier (avec son petit html), mais pas sur la page originale.
    Pourtant le prob de la page envoyée hier est identique au site (c'est juste un extrait du site).
    AU SECOURS !!! Merci pour ton aide
    Bonns soirée,
    dh

  8. #8
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par jreaux62 Voir le message
    c'est bien l'apparition/disparition de la barre de scroll qui crée le décalage.

  9. #9
    Membre habitué
    Homme Profil pro
    Webdesigner
    Inscrit en
    Août 2014
    Messages
    445
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Webdesigner
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Août 2014
    Messages : 445
    Points : 138
    Points
    138
    Par défaut
    Bonjour à tous !
    Mea Culpa !!! En supprimant
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    .fancybox-lock body {
        overflow: hidden !important;
    }
    C'est NIQUEL ! Mais qu'est un fancy-lock ? Et comment un overflow: hidden peut créer un décalage ? Comment sais-tu tout ça ? (désolé pour ces questions
    Cela fait deux semaines minimum que je cherche. Je comprends mieux pourquoi il m'était impossible de résoudre ce problème de CSS tout seul
    Un énorme merci à toi et à NoSmoking de s'être penché sur mon problème (qui était loin d'être simple).
    Bonne journée à vous !!!

    dh

  10. #10
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par dhillig Voir le message
    ...Comment sais-tu tout ça ?...
    + + = =>

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

Discussions similaires

  1. [Pygame]Evénement lors d'un clic sur une image
    Par Dev-DK dans le forum Programmation multimédia/Jeux
    Réponses: 1
    Dernier message: 19/02/2015, 21h41
  2. Réponses: 1
    Dernier message: 16/05/2013, 17h19
  3. Affichage d'un dessin dans un Canvas lors d'un clic sur une image
    Par totooo dans le forum Développement Mobile en Java
    Réponses: 1
    Dernier message: 19/06/2009, 11h26
  4. Exception lors d'un clic sur une feuille d'un arbre
    Par gerudo dans le forum Langage
    Réponses: 4
    Dernier message: 24/04/2009, 09h59
  5. Réponses: 3
    Dernier message: 23/10/2007, 13h35

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