为什么jQuery.noConflict()在此脚本中无效? //版权所有2010 htmldrive.net公司。 /** *@projectHomepage:http://www.htmldrive.net/go/to/desSlideshow *@projectDescription:时尚特色图片幻灯片jQuery插件。 *@author htmldrive.net *更多脚本和css样式:htmldrive.net *@version 1.0 *@许可证http://www.apache.org/licenses/LICENSE-2.0 */ (职能(a){ a、 fn.desSlideshow=功能(p){ var p=p |{}; var autoplay=p&&p.autoplay?p.autoplay:“启用”; var slideshow_width=p&p.slideshow_width?p.slideshow_width:“600”; var slideshow_height=p&p.slideshow_height?p.slideshow_height:“250”; var thumbnail\u width=p&p.thumbnail\u width?p.thumbnail\u width:“200”; var time\u Interval=p&p.time\u Interval?p.time\u Interval:“4000”; var directory=p&&p.directory?p.directory:“图像”; 幻灯片放映高度=parseInt(幻灯片放映高度); 幻灯片宽度=parseInt(幻灯片宽度); 时间间隔=parseInt(时间间隔); var g=a(本); 无功电流=-1; 变量y=g.子项(“.switchBigPic”).子项(“.div”).长度; var v; var-w; 如果(y==0){ g、 附加(“要求内容”); 返回空 } init(); 如果(自动播放=“启用”){ g、 查找(“.switchBigPic”).css(“显示”、“块”); g、 查找(“.nav”).css(“显示”、“块”); g、 css(“背景”、“无”); play(); }否则{ g、 查找(“.switchBigPic”).css(“显示”、“块”); g、 查找(“.nav”).css(“显示”、“块”); g、 css(“背景”、“无”); 电流=0; showpic(); } g、 查找(“.nav”).children(“li”)。悬停( 函数(){ var index=g.find(“.nav”)。children(“li”)。index($(this)); 如果(索引!=当前){ 电流=指数; showpic(); } }, 函数(){ } ); g、 盘旋( 函数(){ }, 函数(){ 如果(自动播放=“启用”){ v=设置超时(播放、时间间隔); } } ); 函数init(){ g、 css(“宽度”,幻灯片宽度+“px”).css(“高度”,幻灯片高度+“px”).css(“位置”,“相对”).css(“字体系列”,“Verdana,Geneva,sans serif”).css(“边框顶部”,“1px实心”,CCCC”).css(“溢出”,“隐藏”); g、 查找(“a”).css(“颜色”,“#000”); g、 查找(“img”).css(“边框”、“无”); g、 查找(“ul”).css(“边距”、“0px”).css(“填充”、“0px”); g、 查找(“li”).css(“边距”、“0px”).css(“填充”、“0px”).css(“列表样式”、“无”); g、 查找(“.switchBigPic”).css(“位置”、“相对”); g、 查找(“.switchBigPic”).children(“div”).css(“位置”、“绝对”).css(“溢出”、“隐藏”); g、 查找(“.switchBigPic”).children(“div”).children(“p”).css(“position”,“absolute”).css(“padding”,“5px”).css(“margin”,“0px”).css(“bottom”,“0px”).css(“opacity”,“0.6”).css(“background color”,“000”).css(“color”,“FFF”).css”,“font size”,“12px”).css(“width”,“100%”; g、 查找(“.nav”).css(“宽度”,缩略图宽度+“px”).css(“高度”,幻灯片放映高度+“px”).css(“位置”,“绝对”).css(“右”,“0px”); g、 查找(“.nav”).children(“li”).css(“height”,“49px”).css(“background image”,“url”(+directory+“flashtext bg.jpg)”).css(“line height”,“49px”).css(“border bottom”,“1px solid”#cccc”).css(“border right”,“1px solid”#cccc”); g、 查找(“.nav”).children(“li”).children(“a”).css(“文本装饰”、“无”).css(“高度”、“49px”).css(“显示”、“块”).css(“左填充”、“25px”).css(“字体大小”、“14px”); g、 查找(“.nav”).children(“li”).css(“左边距”、“0px”); g、 查找(“.switchBigPic”).children(“div”).hide(); } 函数showpic(){ 清除超时(v); g、 查找(“.nav”).children(“li”).css(“背景图像”,“url”(+directory+“flashtext bg.jpg)”).css(“边框底部”,“1px实心”#cccc”); g、 查找(“.nav”).children(“li”).eq(current.css”(“背景图像”、“url”(“+directory+”flash on.gif)”).css(“边框底部”、“无”); g、 查找(“.switchBigPic”).children(“div”).fadeOut(); g、 查找(“.switchBigPic”).children(“div”).eq(current.fadeIn(); g、 查找(“.nav”).children(“li”).eq(当前).animate({marginLeft:'-35px'},“fast”); g、 查找(“.nav”).children(“li”).eq(w).animate({marginLeft:'0px'},“fast”); w=电流; } 函数播放(){ 电流++; 如果(当前>=y){ 电流=0 } showpic(); v=设置超时(播放、时间间隔); } } })(jQuery); var$jl=jQuery.noConflict(); $jl(函数(){ $jl(“#desSlideshow1”)。desSlideshow({ 自动播放:'启用',//选项:启用,禁用 幻灯片宽度:“800”,//幻灯片窗口宽度 幻灯片放映高度:“249”,//幻灯片放映窗口高度 缩略图宽度:“200”,//缩略图宽度 时间间隔:“4000”,//毫秒 目录:'images/'//flash-on.gif和flashtext-bg.jpg目录 }); $jl(“#desSlideshow2”)。desSlideshow({ 自动播放:'禁用',//选项:启用,禁用 幻灯片宽度:“600”,//幻灯片窗口宽度 幻灯片放映高度:“249”,//幻灯片放映窗口高度 缩略图宽度:“120”,//缩略图宽度 时间间隔:“4000”,//毫秒 目录:'images/'//flash-on.gif和flashtext-bg.jpg目录 }); });

为什么jQuery.noConflict()在此脚本中无效? //版权所有2010 htmldrive.net公司。 /** *@projectHomepage:http://www.htmldrive.net/go/to/desSlideshow *@projectDescription:时尚特色图片幻灯片jQuery插件。 *@author htmldrive.net *更多脚本和css样式:htmldrive.net *@version 1.0 *@许可证http://www.apache.org/licenses/LICENSE-2.0 */ (职能(a){ a、 fn.desSlideshow=功能(p){ var p=p |{}; var autoplay=p&&p.autoplay?p.autoplay:“启用”; var slideshow_width=p&p.slideshow_width?p.slideshow_width:“600”; var slideshow_height=p&p.slideshow_height?p.slideshow_height:“250”; var thumbnail\u width=p&p.thumbnail\u width?p.thumbnail\u width:“200”; var time\u Interval=p&p.time\u Interval?p.time\u Interval:“4000”; var directory=p&&p.directory?p.directory:“图像”; 幻灯片放映高度=parseInt(幻灯片放映高度); 幻灯片宽度=parseInt(幻灯片宽度); 时间间隔=parseInt(时间间隔); var g=a(本); 无功电流=-1; 变量y=g.子项(“.switchBigPic”).子项(“.div”).长度; var v; var-w; 如果(y==0){ g、 附加(“要求内容”); 返回空 } init(); 如果(自动播放=“启用”){ g、 查找(“.switchBigPic”).css(“显示”、“块”); g、 查找(“.nav”).css(“显示”、“块”); g、 css(“背景”、“无”); play(); }否则{ g、 查找(“.switchBigPic”).css(“显示”、“块”); g、 查找(“.nav”).css(“显示”、“块”); g、 css(“背景”、“无”); 电流=0; showpic(); } g、 查找(“.nav”).children(“li”)。悬停( 函数(){ var index=g.find(“.nav”)。children(“li”)。index($(this)); 如果(索引!=当前){ 电流=指数; showpic(); } }, 函数(){ } ); g、 盘旋( 函数(){ }, 函数(){ 如果(自动播放=“启用”){ v=设置超时(播放、时间间隔); } } ); 函数init(){ g、 css(“宽度”,幻灯片宽度+“px”).css(“高度”,幻灯片高度+“px”).css(“位置”,“相对”).css(“字体系列”,“Verdana,Geneva,sans serif”).css(“边框顶部”,“1px实心”,CCCC”).css(“溢出”,“隐藏”); g、 查找(“a”).css(“颜色”,“#000”); g、 查找(“img”).css(“边框”、“无”); g、 查找(“ul”).css(“边距”、“0px”).css(“填充”、“0px”); g、 查找(“li”).css(“边距”、“0px”).css(“填充”、“0px”).css(“列表样式”、“无”); g、 查找(“.switchBigPic”).css(“位置”、“相对”); g、 查找(“.switchBigPic”).children(“div”).css(“位置”、“绝对”).css(“溢出”、“隐藏”); g、 查找(“.switchBigPic”).children(“div”).children(“p”).css(“position”,“absolute”).css(“padding”,“5px”).css(“margin”,“0px”).css(“bottom”,“0px”).css(“opacity”,“0.6”).css(“background color”,“000”).css(“color”,“FFF”).css”,“font size”,“12px”).css(“width”,“100%”; g、 查找(“.nav”).css(“宽度”,缩略图宽度+“px”).css(“高度”,幻灯片放映高度+“px”).css(“位置”,“绝对”).css(“右”,“0px”); g、 查找(“.nav”).children(“li”).css(“height”,“49px”).css(“background image”,“url”(+directory+“flashtext bg.jpg)”).css(“line height”,“49px”).css(“border bottom”,“1px solid”#cccc”).css(“border right”,“1px solid”#cccc”); g、 查找(“.nav”).children(“li”).children(“a”).css(“文本装饰”、“无”).css(“高度”、“49px”).css(“显示”、“块”).css(“左填充”、“25px”).css(“字体大小”、“14px”); g、 查找(“.nav”).children(“li”).css(“左边距”、“0px”); g、 查找(“.switchBigPic”).children(“div”).hide(); } 函数showpic(){ 清除超时(v); g、 查找(“.nav”).children(“li”).css(“背景图像”,“url”(+directory+“flashtext bg.jpg)”).css(“边框底部”,“1px实心”#cccc”); g、 查找(“.nav”).children(“li”).eq(current.css”(“背景图像”、“url”(“+directory+”flash on.gif)”).css(“边框底部”、“无”); g、 查找(“.switchBigPic”).children(“div”).fadeOut(); g、 查找(“.switchBigPic”).children(“div”).eq(current.fadeIn(); g、 查找(“.nav”).children(“li”).eq(当前).animate({marginLeft:'-35px'},“fast”); g、 查找(“.nav”).children(“li”).eq(w).animate({marginLeft:'0px'},“fast”); w=电流; } 函数播放(){ 电流++; 如果(当前>=y){ 电流=0 } showpic(); v=设置超时(播放、时间间隔); } } })(jQuery); var$jl=jQuery.noConflict(); $jl(函数(){ $jl(“#desSlideshow1”)。desSlideshow({ 自动播放:'启用',//选项:启用,禁用 幻灯片宽度:“800”,//幻灯片窗口宽度 幻灯片放映高度:“249”,//幻灯片放映窗口高度 缩略图宽度:“200”,//缩略图宽度 时间间隔:“4000”,//毫秒 目录:'images/'//flash-on.gif和flashtext-bg.jpg目录 }); $jl(“#desSlideshow2”)。desSlideshow({ 自动播放:'禁用',//选项:启用,禁用 幻灯片宽度:“600”,//幻灯片窗口宽度 幻灯片放映高度:“249”,//幻灯片放映窗口高度 缩略图宽度:“120”,//缩略图宽度 时间间隔:“4000”,//毫秒 目录:'images/'//flash-on.gif和flashtext-bg.jpg目录 }); });,jquery,slider,gallery,Jquery,Slider,Gallery,您好,我今天在网上看到了一个新的jQuery slider库,并下载了它来学习。 正文中只有一个JS文件和几个块。当我将$更改为jQuery.noConflict()时,它无法工作。为什么?$不会被jQuery取代 // Copyright 2010 htmldrive.net Inc. /** * @projectHomepage: http://www.htmldrive.net/go/to/desSlideshow * @projectDescription: Stylish feat

您好,我今天在网上看到了一个新的jQuery slider库,并下载了它来学习。
正文中只有一个JS文件和几个
块。当我将
$
更改为
jQuery.noConflict()
时,它无法工作。为什么?

$
不会被
jQuery取代
// Copyright 2010 htmldrive.net Inc.
/**
 * @projectHomepage: http://www.htmldrive.net/go/to/desSlideshow
 * @projectDescription: Stylish featured image slideshow jQuery plugin.
 * @author htmldrive.net
 * More script and css style : htmldrive.net
 * @version 1.0
 * @license http://www.apache.org/licenses/LICENSE-2.0
 */
(function(a){
    a.fn.desSlideshow=function(p){
        var p=p||{};

        var autoplay=p&&p.autoplay?p.autoplay:"enable";
        var slideshow_width=p&&p.slideshow_width?p.slideshow_width:"600";
        var slideshow_height=p&&p.slideshow_height?p.slideshow_height:"250";
        var thumbnail_width=p&&p.thumbnail_width?p.thumbnail_width:"200";
        var time_Interval = p&&p.time_Interval?p.time_Interval:"4000";
        var directory=p&&p.directory?p.directory:"images";
        slideshow_height = parseInt(slideshow_height);
        slideshow_width = parseInt(slideshow_width);
        time_Interval = parseInt(time_Interval);
        var g=a(this);
        var current = -1;
        var y=g.children(".switchBigPic").children("div").length;
        var v;
        var w;
        if(y==0){
            g.append("Require content");
            return null
        }
        init();
        if(autoplay == "enable"){
            g.find(".switchBigPic").css("display","block");
            g.find(".nav").css("display","block");
            g.css("background","none");
            play();
        }else{
            g.find(".switchBigPic").css("display","block");
            g.find(".nav").css("display","block");
            g.css("background","none");
            current = 0;
            showpic();
        }
        g.find(".nav").children("li").hover(
            function(){
                var index = g.find(".nav").children("li").index($(this));
                if(index != current){
                    current = index;
                    showpic();
                }
            },
            function(){

            }
        );
        g.hover(
            function(){

            },
            function(){
                if(autoplay == "enable"){
                    v=setTimeout(play,time_Interval);
                }
            }
        );
        function init(){
            g.css("width",slideshow_width+"px").css("height",slideshow_height+"px").css("position","relative").css("font-family","Verdana,Geneva,sans-serif").css("border-top","1px solid #CCCCCC").css("overflow","hidden");
            g.find("a").css("color","#000");
            g.find("img").css("border","none");
            g.find("ul").css("margin","0px").css("padding","0px");
            g.find("li").css("margin","0px").css("padding","0px").css("list-style","none");
            g.find(".switchBigPic").css("position","relative");
            g.find(".switchBigPic").children("div").css("position","absolute").css("overflow","hidden");
            g.find(".switchBigPic").children("div").children("p").css("position","absolute").css("padding","5px").css("margin","0px").css("bottom","0px").css("opacity","0.6").css("background-color","#000").css("color","#FFF").css("font-size","12px").css("width","100%");
            g.find(".nav").css("width",thumbnail_width+"px").css("height",slideshow_height+"px").css("position","absolute").css("right","0px");
            g.find(".nav").children("li").css("height","49px").css("background-image","url("+directory+"flashtext-bg.jpg)").css("line-height","49px").css("border-bottom","1px solid #CCCCCC").css("border-right","1px solid #CCCCCC");
            g.find(".nav").children("li").children("a").css("text-decoration","none").css("height","49px").css("display","block").css("padding-left","25px").css("font-size","14px");
            g.find(".nav").children("li").css("margin-left","0px");
            g.find(".switchBigPic").children("div").hide();
        }
        function showpic(){
            clearTimeout(v);
            g.find(".nav").children("li").css("background-image","url("+directory+"flashtext-bg.jpg)").css("border-bottom","1px solid #CCCCCC");
            g.find(".nav").children("li").eq(current).css("background-image","url("+directory+"flash-on.gif)").css("border-bottom","none");
            g.find(".switchBigPic").children("div").fadeOut();
            g.find(".switchBigPic").children("div").eq(current).fadeIn();
            g.find(".nav").children("li").eq(current).animate({marginLeft: '-35px'}, "fast");
            g.find(".nav").children("li").eq(w).animate({marginLeft: '0px'}, "fast");
            w = current;

        }
        function play(){
            current++;
            if(current>=y){
                current=0
            }
            showpic();
            v=setTimeout(play,time_Interval);
        }
    }
})(jQuery);

<script language="javascript" type="text/javascript">
var $jl = jQuery.noConflict(); 
    $jl(function() {
        $jl("#desSlideshow1").desSlideshow({
            autoplay: 'enable',//option:enable,disable
            slideshow_width: '800',//slideshow window width
            slideshow_height: '249',//slideshow window height
            thumbnail_width: '200',//thumbnail width
            time_Interval: '4000',//Milliseconds
            directory: 'images/'// flash-on.gif and flashtext-bg.jpg directory
        });
        $jl("#desSlideshow2").desSlideshow({
            autoplay: 'disable',//option:enable,disable
            slideshow_width: '600',//slideshow window width
            slideshow_height: '249',//slideshow window height
            thumbnail_width: '120',//thumbnail width
            time_Interval: '4000',//Milliseconds
            directory: 'images/'// flash-on.gif and flashtext-bg.jpg directory
        });
    });
</script>
(function($) {
  //code
})(jQuery)
jQuery(function($) {
  //run stuff on ready
});