Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Personalizzazione di jquery

    Buongiorno , ragazzi avrei bisogno di riuscire a modificare questo script che ho scaricato da internet, fare in modo che l'apertura sia identica alla chiusura come posso fare? lo script è questo:


    Codice PHP:
    /*!
     * jQuery JavaScript Library v1.3.2
     * [url]http://jquery.com/[/url]
     *
     * Copyright (c) 2009 John Resig
     * Dual licensed under the MIT and GPL licenses.
     * [url]http://docs.jquery.com/License[/url]
     *
     * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
     * Revision: 6246
     */
    (function(){

    var 
        
    // Will speed up references to window, and allows munging its name.
        
    window this,
        
    // Will speed up references to undefined, and allows munging its name.
        
    undefined,
        
    // Map over jQuery in case of overwrite
        
    _jQuery window.jQuery,
        
    // Map over the $ in case of overwrite
        
    _$ = window.$,

        
    jQuery window.jQuery window.$ = function( selectorcontext ) {
            
    // The jQuery object is actually just the init constructor 'enhanced'
            
    return new jQuery.fn.initselectorcontext );
        },

        
    // A simple way to check for HTML strings or ID strings
        // (both of which we optimize for)
        
    quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
        // Is it a simple selector
        
    isSimple = /^.[^:#\[\.,]*$/;

    jQuery.fn jQuery.prototype = {
        
    init: function( selectorcontext ) {
            
    // Make sure that a selection was provided
            
    selector selector || document;

            
    // Handle $(DOMElement)
            
    if ( selector.nodeType ) {
                
    this[0] = selector;
                
    this.length 1;
                
    this.context selector;
                return 
    this;
            }
            
    // Handle HTML strings
            
    if ( typeof selector === "string" ) {
                
    // Are we dealing with HTML string or an ID?
                
    var match quickExpr.execselector );

                
    // Verify a match, and that no context was specified for #id
                
    if ( match && (match[1] || !context) ) {

                    
    // HANDLE: $(html) -> $(array)
                    
    if ( match[1] )
                        
    selector jQuery.clean( [ match[1] ], context );

                    
    // HANDLE: $("#id")
                    
    else {
                        var 
    elem document.getElementByIdmatch[3] );

                        
    // Handle the case where IE and Opera return items
                        // by name instead of ID
                        
    if ( elem && elem.id != match[3] )
                            return 
    jQuery().findselector );

                        
    // Otherwise, we inject the element directly into the jQuery object
                        
    var ret jQueryelem || [] );
                        
    ret.context document;
                        
    ret.selector selector;
                        return 
    ret;
                    }

                
    // HANDLE: $(expr, [context])
                // (which is just equivalent to: $(content).find(expr)
                
    } else
                    return 
    jQuerycontext ).findselector );

            
    // HANDLE: $(function)
            // Shortcut for document ready
            
    } else if ( jQuery.isFunctionselector ) )
                return 
    jQuerydocument ).readyselector );

            
    // Make sure that old selector state is passed along
            
    if ( selector.selector && selector.context ) {
                
    this.selector selector.selector;
                
    this.context selector.context;
            }

            return 
    this.setArray(jQuery.isArrayselector ) ?
                
    selector :
                
    jQuery.makeArray(selector));
        },

        
    // Start with an empty selector
        
    selector"",

        
    // The current version of jQuery being used
        
    jquery"1.3.2",

        
    // The number of elements contained in the matched element set
        
    size: function() {
            return 
    this.length;
        },

        
    // Get the Nth element in the matched element set OR
        // Get the whole matched element set as a clean array
        
    get: function( num ) {
            return 
    num === undefined ?

                
    // Return a 'clean' array
                
    Array.prototype.slice.callthis ) :

                
    // Return just the object
                
    thisnum ];
        }, 
    Fine prima parte

  2. #2
    Seconda parte
    Codice PHP:
        // Take an array of elements and push it onto the stack
        // (returning the new matched element set)
        
    pushStack: function( elemsnameselector ) {
            
    // Build a new jQuery matched element set
            
    var ret jQueryelems );

            
    // Add the old object onto the stack (as a reference)
            
    ret.prevObject this;

            
    ret.context this.context;

            if ( 
    name === "find" )
                
    ret.selector this.selector + (this.selector " " "") + selector;
            else if ( 
    name )
                
    ret.selector this.selector "." name "(" selector ")";

            
    // Return the newly-formed element set
            
    return ret;
        },

        
    // Force the current matched set of elements to become
        // the specified array of elements (destroying the stack in the process)
        // You should use pushStack() in order to do this, but maintain the stack
        
    setArray: function( elems ) {
            
    // Resetting the length to 0, then using the native Array push
            // is a super-fast way to populate an object with array-like properties
            
    this.length 0;
            Array.
    prototype.push.applythiselems );

            return 
    this;
        },

        
    // Execute a callback for every element in the matched set.
        // (You can seed the arguments with an array of args, but this is
        // only used internally.)
        
    each: function( callbackargs ) {
            return 
    jQuery.eachthiscallbackargs );
        },

        
    // Determine the position of an element within
        // the matched set of elements
        
    index: function( elem ) {
            
    // Locate the position of the desired element
            
    return jQuery.inArray(
                
    // If it receives a jQuery object, the first element is used
                
    elem && elem.jquery elem[0] : elem
            
    this );
        },

        
    attr: function( namevaluetype ) {
            var 
    options name;

            
    // Look for the case where we're accessing a style value
            
    if ( typeof name === "string" )
                if ( 
    value === undefined )
                    return 
    this[0] && jQuerytype || "attr" ]( this[0], name );

                else {
                    
    options = {};
                    
    optionsname ] = value;
                }

            
    // Check to see if we're setting style values
            
    return this.each(function(i){
                
    // Set all the styles
                
    for ( name in options )
                    
    jQuery.attr(
                        
    type ?
                            
    this.style :
                            
    this,
                        
    namejQuery.propthisoptionsname ], typeiname )
                    );
            });
        },

        
    css: function( keyvalue ) {
            
    // ignore negative width and height values
            
    if ( (key == 'width' || key == 'height') && parseFloat(value) < )
                
    value undefined;
            return 
    this.attrkeyvalue"curCSS" );
        },

        
    text: function( text ) {
            if ( 
    typeof text !== "object" && text != null )
                return 
    this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNodetext ) );

            var 
    ret "";

            
    jQuery.eachtext || this, function(){
                
    jQuery.eachthis.childNodes, function(){
                    if ( 
    this.nodeType != )
                        
    ret += this.nodeType != ?
                            
    this.nodeValue :
                            
    jQuery.fn.text( [ this ] );
                });
            });

            return 
    ret;
        },

        
    wrapAll: function( html ) {
            if ( 
    this[0] ) {
                
    // The elements to wrap the target around
                
    var wrap jQueryhtmlthis[0].ownerDocument ).clone();

                if ( 
    this[0].parentNode )
                    
    wrap.insertBeforethis[0] );

                
    wrap.map(function(){
                    var 
    elem this;

                    while ( 
    elem.firstChild )
                        
    elem elem.firstChild;

                    return 
    elem;
                }).
    append(this);
            }

            return 
    this;
        },

        
    wrapInner: function( html ) {
            return 
    this.each(function(){
                
    jQuerythis ).contents().wrapAllhtml );
            });
        },

        
    wrap: function( html ) {
            return 
    this.each(function(){
                
    jQuerythis ).wrapAllhtml );
            });
        },

        
    append: function() {
            return 
    this.domManip(argumentstrue, function(elem){
                if (
    this.nodeType == 1)
                    
    this.appendChildelem );
            });
        },

        
    prepend: function() {
            return 
    this.domManip(argumentstrue, function(elem){
                if (
    this.nodeType == 1)
                    
    this.insertBeforeelemthis.firstChild );
            });
        },

        
    before: function() {
            return 
    this.domManip(argumentsfalse, function(elem){
                
    this.parentNode.insertBeforeelemthis );
            });
        },

        
    after: function() {
            return 
    this.domManip(argumentsfalse, function(elem){
                
    this.parentNode.insertBeforeelemthis.nextSibling );
            });
        },

        
    end: function() {
            return 
    this.prevObject || jQuery( [] );
        },

        
    // For internal use only.
        // Behaves like an Array's method, not like a jQuery method.
        
    push: [].push,
        
    sort: [].sort,
        
    splice: [].splice,

        
    find: function( selector ) {
            if ( 
    this.length === ) {
                var 
    ret this.pushStack( [], "find"selector );
                
    ret.length 0;
                
    jQuery.findselectorthis[0], ret );
                return 
    ret;
            } else {
                return 
    this.pushStackjQuery.unique(jQuery.map(this, function(elem){
                    return 
    jQuery.findselectorelem );
                })), 
    "find"selector );
            }
        },

        clone: function( 
    events ) {
            
    // Do the clone
            
    var ret this.map(function(){
                if ( !
    jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
                    
    // IE copies events bound via attachEvent when
                    // using cloneNode. Calling detachEvent on the
                    // clone will also remove the events from the orignal
                    // In order to get around this, we use innerHTML.
                    // Unfortunately, this means some modifications to
                    // attributes in IE that are actually only stored
                    // as properties will not be copied (such as the
                    // the name attribute on an input).
                    
    var html this.outerHTML;
                    if ( !
    html ) {
                        var 
    div this.ownerDocument.createElement("div");
                        
    div.appendChildthis.cloneNode(true) );
                        
    html div.innerHTML;
                    }

                    return 
    jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g"").replace(/^\s*/, "")])[0];
                } else
                    return 
    this.cloneNode(true);
            });

            
    // Copy the events from the original to the clone
            
    if ( events === true ) {
                var 
    orig this.find("*").andSelf(), 0;

                
    ret.find("*").andSelf().each(function(){
                    if ( 
    this.nodeName !== orig[i].nodeName )
                        return;

                    var 
    events jQuery.dataorig[i], "events" );

                    for ( var 
    type in events ) {
                        for ( var 
    handler in eventstype ] ) {
                            
    jQuery.event.addthistypeeventstype ][ handler ], eventstype ][ handler ].data );
                        }
                    }

                    
    i++;
                });
            }

            
    // Return the cloned set
            
    return ret;
        },

        
    filter: function( selector ) {
            return 
    this.pushStack(
                
    jQuery.isFunctionselector ) &&
                
    jQuery.grep(this, function(elemi){
                    return 
    selector.callelem);
                }) ||

                
    jQuery.multiFilterselectorjQuery.grep(this, function(elem){
                    return 
    elem.nodeType === 1;
                }) ), 
    "filter"selector );
        },

        
    closest: function( selector ) {
            var 
    pos jQuery.expr.match.POS.testselector ) ? jQuery(selector) : null,
                
    closer 0;

            return 
    this.map(function(){
                var 
    cur this;
                while ( 
    cur && cur.ownerDocument ) {
                    if ( 
    pos pos.index(cur) > -jQuery(cur).is(selector) ) {
                        
    jQuery.data(cur"closest"closer);
                        return 
    cur;
                    }
                    
    cur cur.parentNode;
                    
    closer++;
                }
            });
        },

        
    not: function( selector ) {
            if ( 
    typeof selector === "string" )
                
    // test special case where just one selector is passed in
                
    if ( isSimple.testselector ) )
                    return 
    this.pushStackjQuery.multiFilterselectorthistrue ), "not"selector );
                else
                    
    selector jQuery.multiFilterselectorthis );

            var 
    isArrayLike selector.length && selector[selector.length 1] !== undefined && !selector.nodeType;
            return 
    this.filter(function() {
                return 
    isArrayLike jQuery.inArraythisselector ) < this != selector;
            });
        },

        
    add: function( selector ) {
            return 
    this.pushStackjQuery.uniquejQuery.merge(
                
    this.get(),
                
    typeof selector === "string" ?
                    
    jQueryselector ) :
                    
    jQuery.makeArrayselector )
            )));
        },

        
    is: function( selector ) {
            return !!
    selector && jQuery.multiFilterselectorthis ).length 0;
        },

        
    hasClass: function( selector ) {
            return !!
    selector && this.is"." selector );
        },

        
    val: function( value ) {
            if ( 
    value === undefined ) {            
                var 
    elem this[0];

                if ( 
    elem ) {
                    if( 
    jQuery.nodeNameelem'option' ) )
                        return (
    elem.attributes.value || {}).specified elem.value elem.text;
                    
                    
    // We need to handle select boxes special
                    
    if ( jQuery.nodeNameelem"select" ) ) {
                        var 
    index elem.selectedIndex,
                            
    values = [],
                            
    options elem.options,
                            
    one elem.type == "select-one";

                        
    // Nothing was selected
                        
    if ( index )
                            return 
    null;

                        
    // Loop through all the selected options
                        
    for ( var one index 0max one index options.lengthmaxi++ ) {
                            var 
    option options];

                            if ( 
    option.selected ) {
                                
    // Get the specifc value for the option
                                
    value jQuery(option).val();

                                
    // We don't need an array for one selects
                                
    if ( one )
                                    return 
    value;

                                
    // Multi-Selects return an array
                                
    values.pushvalue );
                            }
                        }

                        return 
    values;                
                    }

                    
    // Everything else, we just grab the value
                    
    return (elem.value || "").replace(/\r/g"");

                }

                return 
    undefined;
            }

            if ( 
    typeof value === "number" )
                
    value += '';

            return 
    this.each(function(){
                if ( 
    this.nodeType != )
                    return;

                if ( 
    jQuery.isArray(value) && /radio|checkbox/.testthis.type ) )
                    
    this.checked = (jQuery.inArray(this.valuevalue) >= ||
                        
    jQuery.inArray(this.namevalue) >= 0);

                else if ( 
    jQuery.nodeNamethis"select" ) ) {
                    var 
    values jQuery.makeArray(value);

                    
    jQuery"option"this ).each(function(){
                        
    this.selected = (jQuery.inArraythis.valuevalues ) >= ||
                            
    jQuery.inArraythis.textvalues ) >= 0);
                    });

                    if ( !
    values.length )
                        
    this.selectedIndex = -1;

                } else
                    
    this.value value;
            });
        },

        
    html: function( value ) {
            return 
    value === undefined ?
                (
    this[0] ?
                    
    this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g"") :
                    
    null) :
                
    this.empty().appendvalue );
        },

        
    replaceWith: function( value ) {
            return 
    this.aftervalue ).remove();
        },

        
    eq: function( ) {
            return 
    this.slicei, +);
        },

        
    slice: function() {
            return 
    this.pushStack( Array.prototype.slice.applythisarguments ),
                
    "slice", Array.prototype.slice.call(arguments).join(",") );
        },

        
    map: function( callback ) {
            return 
    this.pushStackjQuery.map(this, function(elemi){
                return 
    callback.callelemielem );
            }));
        },

        
    andSelf: function() {
            return 
    this.addthis.prevObject );
        },

        
    domManip: function( argstablecallback ) {
            if ( 
    this[0] ) {
                var 
    fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
                    
    scripts jQuery.cleanargs, (this[0].ownerDocument || this[0]), fragment ),
                    
    first fragment.firstChild;

                if ( 
    first )
                    for ( var 
    0this.lengthli++ )
                        
    callback.callroot(this[i], first), this.length || ?
                                
    fragment.cloneNode(true) : fragment );
            
                if ( 
    scripts )
                    
    jQuery.eachscriptsevalScript );
            }

            return 
    this;
            
            function 
    rootelemcur ) {
                return 
    table && jQuery.nodeName(elem"table") && jQuery.nodeName(cur"tr") ?
                    (
    elem.getElementsByTagName("tbody")[0] ||
                    
    elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
                    
    elem;
            }
        }
    };

    // Give the init function the jQuery prototype for later instantiation
    jQuery.fn.init.prototype jQuery.fn;

    function 
    evalScriptielem ) {
        if ( 
    elem.src )
            
    jQuery.ajax({
                
    urlelem.src,
                
    asyncfalse,
                
    dataType"script"
            
    });

        else
            
    jQuery.globalEvalelem.text || elem.textContent || elem.innerHTML || "" );

        if ( 
    elem.parentNode )
            
    elem.parentNode.removeChildelem );


  3. #3
    NOn riesco a postarlo tutto, vi do direttamente il link del file js

    Sapreste dirmi come posso fare in modo che l'apertura sia identica alla chiusura?

    grazie in anticipo per le risposte
    Script javascript

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.