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 :

Pourquoi jquery Reveal Modal 1.0 ne fonctionne pas avec jquery 2.1.4 ? [Plugin]


Sujet :

jQuery

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Expert confirmé Avatar de Toufik83
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2012
    Messages
    2 525
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 2 525
    Par défaut Pourquoi jquery Reveal Modal 1.0 ne fonctionne pas avec jquery 2.1.4 ?
    bonjour,

    j'essaie depuis quelques temps de corriger un petit détail, mais sans réussite.

    j'utilisai la version 1.10 de Jquery puis je l'ai remplacé par Jquery 2.1.4 et c'est là que le problème apparaît.

    la fenêtre modal ne s'affiche plus et les requettes ajax ne sont pas reconnus, quelqu'un pourrait m'aider s'il vous plait?

    code html :

    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    <script type="text/javascript" src="../Scripts/jquery-2.1.4.js"></script>
    <script type="text/javascript" src="../Scripts/jquery-2.1.4.min.js" ></script>
    <script type="text/javascript" src="../Scripts/jquery-migrate.js" ></script>
    <script type="text/javascript" src="../Scripts/jquery-ui.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.reveal.js"></script>
    <script type="text/javascript" src="../Scripts/MaFonction.js"></script>
    <script type="text/javascript" src="../Scripts/JScript.js" ></script>

    jquery Migrate :
    Code javascript : 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
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
     
    /*!
    * jQuery Migrate - v1.2.1 - 2013-05-08
    * https://github.com/jquery/jquery-migrate
    * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
    */
    (function (jQuery, window, undefined) {
        // See http://bugs.jquery.com/ticket/13335
        // "use strict";
     
     
        var warnedAbout = {};
     
        // List of warnings already given; public read only
        jQuery.migrateWarnings = [];
     
        // Set to true to prevent console output; migrateWarnings still maintained
        // jQuery.migrateMute = false;
     
        // Show a message on the console so devs know we're active
        if (!jQuery.migrateMute && window.console && window.console.log) {
            window.console.log("JQMIGRATE: Logging is active");
        }
     
        // Set to false to disable traces that appear with warnings
        if (jQuery.migrateTrace === undefined) {
            jQuery.migrateTrace = true;
        }
     
        // Forget any warnings we've already given; public
        jQuery.migrateReset = function () {
            warnedAbout = {};
            jQuery.migrateWarnings.length = 0;
        };
     
        function migrateWarn(msg) {
            var console = window.console;
            if (!warnedAbout[msg]) {
                warnedAbout[msg] = true;
                jQuery.migrateWarnings.push(msg);
                if (console && console.warn && !jQuery.migrateMute) {
                    console.warn("JQMIGRATE: " + msg);
                    if (jQuery.migrateTrace && console.trace) {
                        console.trace();
                    }
                }
            }
        }
     
        function migrateWarnProp(obj, prop, value, msg) {
            if (Object.defineProperty) {
                // On ES5 browsers (non-oldIE), warn if the code tries to get prop;
                // allow property to be overwritten in case some other plugin wants it
                try {
                    Object.defineProperty(obj, prop, {
                        configurable: true,
                        enumerable: true,
                        get: function () {
                            migrateWarn(msg);
                            return value;
                        },
                        set: function (newValue) {
                            migrateWarn(msg);
                            value = newValue;
                        }
                    });
                    return;
                } catch (err) {
                    // IE8 is a dope about Object.defineProperty, can't warn there
                }
            }
     
            // Non-ES5 (or broken) browser; just set the property
            jQuery._definePropertyBroken = true;
            obj[prop] = value;
        }
     
        if (document.compatMode === "BackCompat") {
            // jQuery has never supported or tested Quirks Mode
            migrateWarn("jQuery is not compatible with Quirks Mode");
        }
     
     
        var attrFn = jQuery("<input/>", { size: 1 }).attr("size") && jQuery.attrFn,
    	oldAttr = jQuery.attr,
    	valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
    		function () { return null; },
    	valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
    		function () { return undefined; },
    	rnoType = /^(?:input|button)$/i,
    	rnoAttrNodeType = /^[238]$/,
    	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
    	ruseDefault = /^(?:checked|selected)$/i;
     
        // jQuery.attrFn
        migrateWarnProp(jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated");
     
        jQuery.attr = function (elem, name, value, pass) {
            var lowerName = name.toLowerCase(),
    		nType = elem && elem.nodeType;
     
            if (pass) {
                // Since pass is used internally, we only warn for new jQuery
                // versions where there isn't a pass arg in the formal params
                if (oldAttr.length < 4) {
                    migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
                }
                if (elem && !rnoAttrNodeType.test(nType) &&
    			(attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name]))) {
                    return jQuery(elem)[name](value);
                }
            }
     
            // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
            // for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
            if (name === "type" && value !== undefined && rnoType.test(elem.nodeName) && elem.parentNode) {
                migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
            }
     
            // Restore boolHook for boolean property/attribute synchronization
            if (!jQuery.attrHooks[lowerName] && rboolean.test(lowerName)) {
                jQuery.attrHooks[lowerName] = {
                    get: function (elem, name) {
                        // Align boolean attributes with corresponding properties
                        // Fall back to attribute presence where some booleans are not supported
                        var attrNode,
    					property = jQuery.prop(elem, name);
                        return property === true || typeof property !== "boolean" &&
    					(attrNode = elem.getAttributeNode(name)) && attrNode.nodeValue !== false ?
     
    					name.toLowerCase() :
    					undefined;
                    },
                    set: function (elem, value, name) {
                        var propName;
                        if (value === false) {
                            // Remove boolean attributes when set to false
                            jQuery.removeAttr(elem, name);
                        } else {
                            // value is true since we know at this point it's type boolean and not false
                            // Set boolean attributes to the same name and set the DOM property
                            propName = jQuery.propFix[name] || name;
                            if (propName in elem) {
                                // Only set the IDL specifically if it already exists on the element
                                elem[propName] = true;
                            }
     
                            elem.setAttribute(name, name.toLowerCase());
                        }
                        return name;
                    }
                };
     
                // Warn only for attributes that can remain distinct from their properties post-1.9
                if (ruseDefault.test(lowerName)) {
                    migrateWarn("jQuery.fn.attr('" + lowerName + "') may use property instead of attribute");
                }
            }
     
            return oldAttr.call(jQuery, elem, name, value);
        };
     
        // attrHooks: value
        jQuery.attrHooks.value = {
            get: function (elem, name) {
                var nodeName = (elem.nodeName || "").toLowerCase();
                if (nodeName === "button") {
                    return valueAttrGet.apply(this, arguments);
                }
                if (nodeName !== "input" && nodeName !== "option") {
                    migrateWarn("jQuery.fn.attr('value') no longer gets properties");
                }
                return name in elem ?
    			elem.value :
    			null;
            },
            set: function (elem, value) {
                var nodeName = (elem.nodeName || "").toLowerCase();
                if (nodeName === "button") {
                    return valueAttrSet.apply(this, arguments);
                }
                if (nodeName !== "input" && nodeName !== "option") {
                    migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
                }
                // Does not return so that setAttribute is also used
                elem.value = value;
            }
        };
     
     
        var matched, browser,
    	oldInit = jQuery.fn.init,
    	oldParseJSON = jQuery.parseJSON,
        // Note: XSS check is done below after string is trimmed
    	rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
     
        // $(html) "looks like html" rule change
        jQuery.fn.init = function (selector, context, rootjQuery) {
            var match;
     
            if (selector && typeof selector === "string" && !jQuery.isPlainObject(context) &&
    			(match = rquickExpr.exec(jQuery.trim(selector))) && match[0]) {
                // This is an HTML string according to the "old" rules; is it still?
                if (selector.charAt(0) !== "<") {
                    migrateWarn("$(html) HTML strings must start with '<' character");
                }
                if (match[3]) {
                    migrateWarn("$(html) HTML text after last tag is ignored");
                }
                // Consistently reject any HTML-like string starting with a hash (#9521)
                // Note that this may break jQuery 1.6.x code that otherwise would work.
                if (match[0].charAt(0) === "#") {
                    migrateWarn("HTML string cannot start with a '#' character");
                    jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
                }
                // Now process using loose rules; let pre-1.8 play too
                if (context && context.context) {
                    // jQuery object as context; parseHTML expects a DOM object
                    context = context.context;
                }
                if (jQuery.parseHTML) {
                    return oldInit.call(this, jQuery.parseHTML(match[2], context, true),
    					context, rootjQuery);
                }
            }
            return oldInit.apply(this, arguments);
        };
        jQuery.fn.init.prototype = jQuery.fn;
     
        // Let $.parseJSON(falsy_value) return null
        jQuery.parseJSON = function (json) {
            if (!json && json !== null) {
                migrateWarn("jQuery.parseJSON requires a valid JSON string");
                return null;
            }
            return oldParseJSON.apply(this, arguments);
        };
     
        jQuery.uaMatch = function (ua) {
            ua = ua.toLowerCase();
     
            var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
    		/(webkit)[ \/]([\w.]+)/.exec(ua) ||
    		/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
    		/(msie) ([\w.]+)/.exec(ua) ||
    		ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
    		[];
     
            return {
                browser: match[1] || "",
                version: match[2] || "0"
            };
        };
     
        // Don't clobber any existing jQuery.browser in case it's different
        if (!jQuery.browser) {
            matched = jQuery.uaMatch(navigator.userAgent);
            browser = {};
     
            if (matched.browser) {
                browser[matched.browser] = true;
                browser.version = matched.version;
            }
     
            // Chrome is Webkit, but Webkit is also Safari.
            if (browser.chrome) {
                browser.webkit = true;
            } else if (browser.webkit) {
                browser.safari = true;
            }
     
            jQuery.browser = browser;
        }
     
        // Warn if the code tries to get jQuery.browser
        migrateWarnProp(jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated");
     
        jQuery.sub = function () {
            function jQuerySub(selector, context) {
                return new jQuerySub.fn.init(selector, context);
            }
            jQuery.extend(true, jQuerySub, this);
            jQuerySub.superclass = this;
            jQuerySub.fn = jQuerySub.prototype = this();
            jQuerySub.fn.constructor = jQuerySub;
            jQuerySub.sub = this.sub;
            jQuerySub.fn.init = function init(selector, context) {
                if (context && context instanceof jQuery && !(context instanceof jQuerySub)) {
                    context = jQuerySub(context);
                }
     
                return jQuery.fn.init.call(this, selector, context, rootjQuerySub);
            };
            jQuerySub.fn.init.prototype = jQuerySub.fn;
            var rootjQuerySub = jQuerySub(document);
            migrateWarn("jQuery.sub() is deprecated");
            return jQuerySub;
        };
     
     
        // Ensure that $.ajax gets the new parseJSON defined in core.js
        jQuery.ajaxSetup({
            converters: {
                "text json": jQuery.parseJSON
            }
        });
     
     
        var oldFnData = jQuery.fn.data;
     
        jQuery.fn.data = function (name) {
            var ret, evt,
    		elem = this[0];
     
            // Handles 1.7 which has this behavior and 1.8 which doesn't
            if (elem && name === "events" && arguments.length === 1) {
                ret = jQuery.data(elem, name);
                evt = jQuery._data(elem, name);
                if ((ret === undefined || ret === evt) && evt !== undefined) {
                    migrateWarn("Use of jQuery.fn.data('events') is deprecated");
                    return evt;
                }
            }
            return oldFnData.apply(this, arguments);
        };
     
     
        var rscriptType = /\/(java|ecma)script/i,
    	oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
     
        jQuery.fn.andSelf = function () {
            migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
            return oldSelf.apply(this, arguments);
        };
     
        // Since jQuery.clean is used internally on older versions, we only shim if it's missing
        if (!jQuery.clean) {
            jQuery.clean = function (elems, context, fragment, scripts) {
                // Set context per 1.8 logic
                context = context || document;
                context = !context.nodeType && context[0] || context;
                context = context.ownerDocument || context;
     
                migrateWarn("jQuery.clean() is deprecated");
     
                var i, elem, handleScript, jsTags,
    			ret = [];
     
                jQuery.merge(ret, jQuery.buildFragment(elems, context).childNodes);
     
                // Complex logic lifted directly from jQuery 1.8
                if (fragment) {
                    // Special handling of each script element
                    handleScript = function (elem) {
                        // Check if we consider it executable
                        if (!elem.type || rscriptType.test(elem.type)) {
                            // Detach the script and store it in the scripts array (if provided) or the fragment
                            // Return truthy to indicate that it has been handled
                            return scripts ?
    						scripts.push(elem.parentNode ? elem.parentNode.removeChild(elem) : elem) :
    						fragment.appendChild(elem);
                        }
                    };
     
                    for (i = 0; (elem = ret[i]) != null; i++) {
                        // Check if we're done after handling an executable script
                        if (!(jQuery.nodeName(elem, "script") && handleScript(elem))) {
                            // Append to fragment and handle embedded scripts
                            fragment.appendChild(elem);
                            if (typeof elem.getElementsByTagName !== "undefined") {
                                // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
                                jsTags = jQuery.grep(jQuery.merge([], elem.getElementsByTagName("script")), handleScript);
     
                                // Splice the scripts into ret after their former ancestor and advance our index beyond them
                                ret.splice.apply(ret, [i + 1, 0].concat(jsTags));
                                i += jsTags.length;
                            }
                        }
                    }
                }
     
                return ret;
            };
        }
     
        var eventAdd = jQuery.event.add,
    	eventRemove = jQuery.event.remove,
    	eventTrigger = jQuery.event.trigger,
    	oldToggle = jQuery.fn.toggle,
    	oldLive = jQuery.fn.live,
    	oldDie = jQuery.fn.die,
    	ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
    	rajaxEvent = new RegExp("\\b(?:" + ajaxEvents + ")\\b"),
    	rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
    	hoverHack = function (events) {
    	    if (typeof (events) !== "string" || jQuery.event.special.hover) {
    	        return events;
    	    }
    	    if (rhoverHack.test(events)) {
    	        migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
    	    }
    	    return events && events.replace(rhoverHack, "mouseenter$1 mouseleave$1");
    	};
     
        // Event props removed in 1.9, put them back if needed; no practical way to warn them
        if (jQuery.event.props && jQuery.event.props[0] !== "attrChange") {
            jQuery.event.props.unshift("attrChange", "attrName", "relatedNode", "srcElement");
        }
     
        // Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
        if (jQuery.event.dispatch) {
            migrateWarnProp(jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated");
        }
     
        // Support for 'hover' pseudo-event and ajax event warnings
        jQuery.event.add = function (elem, types, handler, data, selector) {
            if (elem !== document && rajaxEvent.test(types)) {
                migrateWarn("AJAX events should be attached to document: " + types);
            }
            eventAdd.call(this, elem, hoverHack(types || ""), handler, data, selector);
        };
        jQuery.event.remove = function (elem, types, handler, selector, mappedTypes) {
            eventRemove.call(this, elem, hoverHack(types) || "", handler, selector, mappedTypes);
        };
     
        jQuery.fn.error = function () {
            var args = Array.prototype.slice.call(arguments, 0);
            migrateWarn("jQuery.fn.error() is deprecated");
            args.splice(0, 0, "error");
            if (arguments.length) {
                return this.bind.apply(this, args);
            }
            // error event should not bubble to window, although it does pre-1.7
            this.triggerHandler.apply(this, args);
            return this;
        };
     
        jQuery.fn.toggle = function (fn, fn2) {
     
            // Don't mess with animation or css toggles
            if (!jQuery.isFunction(fn) || !jQuery.isFunction(fn2)) {
                return oldToggle.apply(this, arguments);
            }
            migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
     
            // Save reference to arguments for access in closure
            var args = arguments,
    		guid = fn.guid || jQuery.guid++,
    		i = 0,
    		toggler = function (event) {
    		    // Figure out which function to execute
    		    var lastToggle = (jQuery._data(this, "lastToggle" + fn.guid) || 0) % i;
    		    jQuery._data(this, "lastToggle" + fn.guid, lastToggle + 1);
     
    		    // Make sure that clicks stop
    		    event.preventDefault();
     
    		    // and execute the function
    		    return args[lastToggle].apply(this, arguments) || false;
    		};
     
            // link all the functions, so any of them can unbind this click handler
            toggler.guid = guid;
            while (i < args.length) {
                args[i++].guid = guid;
            }
     
            return this.click(toggler);
        };
     
        jQuery.fn.live = function (types, data, fn) {
            migrateWarn("jQuery.fn.live() is deprecated");
            if (oldLive) {
                return oldLive.apply(this, arguments);
            }
            jQuery(this.context).on(types, this.selector, data, fn);
            return this;
        };
     
        jQuery.fn.die = function (types, fn) {
            migrateWarn("jQuery.fn.die() is deprecated");
            if (oldDie) {
                return oldDie.apply(this, arguments);
            }
            jQuery(this.context).off(types, this.selector || "**", fn);
            return this;
        };
     
        // Turn global events into document-triggered events
        jQuery.event.trigger = function (event, data, elem, onlyHandlers) {
            if (!elem && !rajaxEvent.test(event)) {
                migrateWarn("Global events are undocumented and deprecated");
            }
            return eventTrigger.call(this, event, data, elem || document, onlyHandlers);
        };
        jQuery.each(ajaxEvents.split("|"),
    	function (_, name) {
    	    jQuery.event.special[name] = {
    	        setup: function () {
    	            var elem = this;
     
    	            // The document needs no shimming; must be !== for oldIE
    	            if (elem !== document) {
    	                jQuery.event.add(document, name + "." + jQuery.guid, function () {
    	                    jQuery.event.trigger(name, null, elem, true);
    	                });
    	                jQuery._data(this, name, jQuery.guid++);
    	            }
    	            return false;
    	        },
    	        teardown: function () {
    	            if (this !== document) {
    	                jQuery.event.remove(document, name + "." + jQuery._data(this, name));
    	            }
    	            return false;
    	        }
    	    };
    	}
    );
     
     
    })(jQuery, window);

    reveal modal :

    Code javascript : 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
     
    /*
     * jQuery Reveal Plugin 1.0
     * www.ZURB.com
     * Copyright 2010, ZURB
     * Free to use under the MIT license.
     * http://www.opensource.org/licenses/mit-license.php
    */
     
     
    (function ($) {
     
        /*---------------------------
        Defaults for Reveal
        ----------------------------*/
     
        /*---------------------------
        Listener for data-reveal-id attributes
        ----------------------------*/
     
        $("a[data-reveal-id]").on("click", function (e) {
     
            var modalLocation = $(this).attr("data-reveal-id");
            $("#" + modalLocation).reveal($(this).data());
            return false;
            e.preventDefault();
        });
     
        /*---------------------------
        Extend and Execute
        ----------------------------*/
     
        $.fn.reveal = function (options) {
     
     
            var defaults = {
                animation: "fadeAndPop", //fade, fadeAndPop, none
                animationspeed: 300, //how fast animtions are
                closeonbackgroundclick: true, //if you click background will modal close?
                dismissmodalclass: "close-reveal-modal" //the class of a button or element that will close an open modal
            };
     
            //Extend dem' options
            var options = $.extend({}, defaults, options);
     
            return this.each(function () {
     
                /*---------------------------
                Global Variables
                ----------------------------*/
                var modal = $(this),
            		topMeasure = parseInt(modal.css("top")),
    				topOffset = modal.height() + topMeasure,
              		locked = false,
    				modalBG = $(".reveal-modal-bg");
     
                /*---------------------------
                Create Modal BG
                ----------------------------*/
                if (modalBG.length == 0) {
                    modalBG = $("<div class='reveal-modal-bg' />").insertAfter(modal);
                }
     
                /*---------------------------
                Open & Close Animations
                ----------------------------*/
                //Entrance Animations
                modal.bind("reveal:open", function () {
                    modalBG.unbind("click.modalEvent");
                    $('.' + options.dismissmodalclass).unbind("click.modalEvent");
                    if (!locked) {
                        lockModal();
                        if (options.animation == "fadeAndPop") {
                            modal.css({ "top": $(document).scrollTop() - topOffset, "opacity": 0, "visibility": "visible" });
                            modalBG.fadeIn(options.animationspeed / 2);
                            modal.delay(options.animationspeed / 2).animate({
                                "top": $(document).scrollTop() + topMeasure + "px",
                                "opacity": 1
                            }, options.animationspeed, unlockModal());
                        }
                        if (options.animation == "fade") {
                            modal.css({ "opacity": 0, "visibility": "visible", "top": $(document).scrollTop() + topMeasure });
                            modalBG.fadeIn(options.animationspeed / 2);
                            modal.delay(options.animationspeed / 2).animate({
                                "opacity": 1
                            }, options.animationspeed, unlockModal());
                        }
                        if (options.animation == "none") {
                            modal.css({ "visibility": "visible", "top": $(document).scrollTop() + topMeasure });
                            modalBG.css({ "display": "block" });
                            unlockModal();
                        }
                    }
                    modal.unbind("reveal:open");
                });
     
                //Closing Animation
                modal.bind("reveal:close", function () {
                    if (!locked) {
                        lockModal();
                        if (options.animation == "fadeAndPop") {
                            modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);
                            modal.animate({
                                "top": $(document).scrollTop() - topOffset + "px",
                                "opacity": 0
                            }, options.animationspeed / 2, function () {
                                modal.css({ "top": topMeasure, "opacity": 1, "visibility": "hidden" });
                                unlockModal();
                            });
                        }
                        if (options.animation == "fade") {
                            modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);
                            modal.animate({
                                "opacity": 0
                            }, options.animationspeed, function () {
                                modal.css({ "opacity": 1, "visibility": "hidden", "top": topMeasure });
                                unlockModal();
                            });
                        }
                        if (options.animation == "none") {
                            modal.css({ "visibility": "hidden", "top": topMeasure });
                            modalBG.css({ "display": "none" });
                        }
                    }
                    modal.unbind("reveal:close");
                });
     
                /*---------------------------
                Open and add Closing Listeners
                ----------------------------*/
                //Open Modal Immediately
                modal.trigger("reveal:open");
     
                //Close Modal Listeners
                var closeButton = $("." + options.dismissmodalclass).bind("click.modalEvent", function () {
                    modal.trigger("reveal:close");
                });
     
                if (options.closeonbackgroundclick) {
                    modalBG.css({ "cursor": "pointer" })
                    modalBG.bind("click.modalEvent", function () {
                        modal.trigger("reveal:close");
                    });
                }
                $("body").keyup(function (e) {
                    if (e.which === 27) { modal.trigger("reveal:close"); } // 27 is the keycode for the Escape key
                });
     
     
                /*---------------------------
                Animations Locks
                ----------------------------*/
                function unlockModal() {
                    locked = false;
                }
                function lockModal() {
                    locked = true;
                }
     
            }); //each call
        } //orbit plugin call
    })(jQuery);

  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 : 75
    Localisation : Belgique

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

    Informations forums :
    Inscription : Février 2009
    Messages : 6 389
    Billets dans le blog
    125
    Par défaut
    1. Trop de jQuery nuit à la bonne santé de jQuery

      Code : Sélectionner tout - Visualiser dans une fenêtre à part
      1
      2
      3
      <script type="text/javascript" src="../Scripts/jquery-2.1.4.js"></script>
      <script type="text/javascript" src="../Scripts/jquery-2.1.4.min.js" ></script>
      <script type="text/javascript" src="../Scripts/jquery-migrate.js" ></script>
      jQuery 2.1.4 n'est pas compatible avec les navigateurs obsolètes : IE <= 8. L'équivalent compatible est "http://code.jquery.com/jquery-1.11.3.js"

      En développement, pour tester des codes existants, vous pouvez utiliser la version 2.1.4 non compressée (donc sans l'abréviation min du mot minified) et le plugin de migration (jquery-migrate).

      Mais en production et pour tester de nouveaux codes, vous devez utiliser exclusivement la version compressée : jquery-2.1.4.min.js.
      ----

    2. Le plugin jquery.reveal.js est obsolète : "This version of Reveal has been deprecated and will no longer be developed or supported."

    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
    Expert confirmé Avatar de Toufik83
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2012
    Messages
    2 525
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 2 525
    Par défaut
    bonsoir,

    merci danielhagnoul pour vos explications, franchement j'utilise Jquery depuis 3 ans(requettes ajax, post, get,paginate...) pourtant je n'arrive pas a comprendre ses comportements 100%.

    je me demande :

    1- qu'elle version de jquery-reveal est compatible avec ma version de jquery que j'utilise?
    2-vous avez dit "en développement" et "en production", qu'est ce que vous voulez dire par ça?

  4. #4
    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 : 75
    Localisation : Belgique

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

    Informations forums :
    Inscription : Février 2009
    Messages : 6 389
    Billets dans le blog
    125
    Par défaut
    1. Code obsolète (deprecated) : l'auteur sait que son code est défaillant. Il déclare que ce code ne doit plus être utilisé.
    2. En développement : le code est en cours de construction ou de test, il est sur votre ordinateur ou sur un serveur de test.
    3. En production : le code (compressé, minified) est au point, il est au travail sur le serveur diffusant les pages web.

    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.)

  5. #5
    Expert confirmé Avatar de Toufik83
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2012
    Messages
    2 525
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2012
    Messages : 2 525
    Par défaut
    Bonjour,

    Merci beaucoup Daniel, maintenant j'ai bien compris les failles que je faisais.
    j'ai du changer le plugin jquery-reveal.js par Colorbox() (http://www.jacklmoore.com/colorbox/example2/) et cela fonctionne sauf que j'ai un petit souci.

    j'utilise Ajax pour afficher mes données venant de la base de donnée via le Clique sur l'element <a class='Editer Inline'> qui a été crée dynamiquement avec Jquery,voila le code :

    Code javascript : 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
     
    //debut Editer
            $("#Cont #divContenent").on("click", "span a.Editer", function () {
                //alert(parseInt($(this).attr("id")));
                var Id = parseInt($(this).attr("id"));
                var modal = ""; var donner = { Id: Id };
                if (Id != -1 && Id > 0) {
                    $.ajax({
                        type: "POST",
                        url: "../GestionCatego/Default.aspx/Editer",
                        data: JSON.stringify(donner),
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        cache: false,
                        success: function (msgE) {
                            for (var i = 0; i < msgE.d.length; i++) {
                                $("#contModals #inline_content").append("<img alt='' src='../photos/" + msgE.d[i].Image +
                                "'/></br>Titre " + msgE.d[i].Titre + " </br>Date " + msgE.d[i].Date);
                                $("#inline_content").colorbox();
                            }
                        }
                    });
                }
                return false;
            });
            //fin Editer-----------------------------
    puis le html
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    <div id="contModals">
            <div id="inline_content" ></div>
            ....
     
    </div>

    les données sont affichées correctement dans la div id="inline_content". je veux savoir comment faire pour que les données soient affichées dans le Colorbox() ?

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

Discussions similaires

  1. Slider jQuery ne fonctionne pas avec IE
    Par ElBono dans le forum jQuery
    Réponses: 2
    Dernier message: 21/12/2011, 10h30
  2. Réponses: 6
    Dernier message: 19/10/2011, 12h18
  3. IE fonctionne mal avec Jquery
    Par john2706 dans le forum jQuery
    Réponses: 2
    Dernier message: 07/11/2009, 21h44
  4. Jquery/AJAX function click qui ne fonctionne pas.
    Par prome dans le forum jQuery
    Réponses: 2
    Dernier message: 12/03/2009, 12h57
  5. Réponses: 8
    Dernier message: 12/12/2007, 19h11

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