jsFiddle显示正确,但一旦在本地运行就不会';t工作(Javascript)

jsFiddle显示正确,但一旦在本地运行就不会';t工作(Javascript),javascript,jquery,html,local,jsfiddle,Javascript,Jquery,Html,Local,Jsfiddle,我有可以在JSFIDLE中工作的代码,但一旦在本地运行它,它就不工作了 导致此代码工作的是JSFIDLE,而不是本地代码?本地代码只不过是JSFIDLE中内容的精确复制和粘贴 干杯 正在本地运行的代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> &l

我有可以在JSFIDLE中工作的代码,但一旦在本地运行它,它就不工作了


导致此代码工作的是JSFIDLE,而不是本地代码?本地代码只不过是JSFIDLE中内容的精确复制和粘贴

干杯

正在本地运行的代码:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>Blob.net</title>
     <style>
     #container {
    background-color:#CCC;
    margin-top: 100px;
    margin-right: auto;
    margin-bottom: 100px;
    margin-left: auto;  
    width: 1200px;
    height: auto;
    box-shadow: 0px 0px 10px 2px rgba(119, 119, 119, 0.75);
    -moz-box-shadow: 0px 0px 10px 2px rgba(119, 119, 119, 0.75);
    -webkit-box-shadow: 0px 0px 10px 2px rgba(119, 119, 119, 0.75);
     }

     /* HEADER CSS */

     #header {
    width: 100%;
    height: 75px;
    background-color: #FC6;
    padding-top: 2px;
    padding-bottom: 10px;
     }
     #header_text h1{
    font-family: "Arial Black", Gadget, sans-serif;
    margin-left: 32%;
     }

     /* CONTENT CSS */

     #left {
    width: 800px;
    height: auto;   
    background-color: #CF9; 
    float: left;
     }
     #left_inside {
    padding-left: 15px;
    padding-right: 15px;
    margin-bottom: 30px;
     }
     #left p {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;  
     }

     /* SIDEBAR CSS */

     #right {
    width: 400px;
    height: auto;   
    background-color:#6CF;
    float: right;
     }
     .elements {
    border: 1px solid #000; 
    height: auto;
    width: 400px;
    min-height: 180px;
     }
    /* NAV BAR STYLES */

    #right ul {
        list-style-type: none;
        margin-left: 25%;
    }
    #right ul li{
        margin-top: 30px;
    }
    #right ul li a:link{
        text-decoration: none;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        color: #000;
    }
    #right ul li a:hover{
        color: #CCC;
    }

        /* ROWS */

        .row1 {
            background-color:#930;
        }
        .row2 {
            background-color: #633;
        }
        .row3 {
            background-color: #C66;
        }
        .row4 {
            background-color: #96F;
        }
        .row5 {
            background-color: #FF0;
        }

     /* END SIDEBAR CSS */

     .clear {
    clear: both;    
     }

     /* MAKE SIDE BAR STICKY*/
     .stick {
    position: fixed;
    bottom: 0;
     }
     </style>
     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
     <script>
     var initialpos=$('#right').offset();
     $('#container').css('max-height',$('#container').height()+'px')



     var set=0;
     $(window).scroll(function(e){



    var currPos=document.getElementById('right').getBoundingClientRect();
    var windowScrolled=$(window).scrollTop();
    var containerBottom=$('#container').height()+$('#container').offset().top;
    var windowScrolledafterRight = $(window).scrollTop()+$('#right').height();



    if(windowScrolled>initialpos.top && containerBottom>windowScrolledafterRight){


        $('#right').css({'margin-top':$(window).scrollTop()-initialpos.top});
        set=1;

    }

    if(containerBottom<windowScrolledafterRight)
    {
        $('#right').css({'margin-top':$('#container').height()-     $('#header').height()-10-$('#right').height()});
    }


    if(windowScrolled<initialpos.top)
    {

        $('#right').css({'margin-top':'0'});
    }

     })
     </script>
     </head>
     <body>
     <!-- MAIN CONTAINER -->
     <div id="container">

    <!-- HEADER -->
    <div id="header"> 
        <div id="header_text">
            <h1>This is a fancy header</h1>
        </div>
    </div>
    <!-- END HEADER -->


    <!-- MAIN CONTENT -->
    <div id="left">
        <div id="left_inside">
            <p>+1 literally bespoke seitan fashion axe retro semiotics.  Neutra forage sartorial, XOXO Shoreditch cornhole Blue Bottle.  Pork belly Wes Anderson bicycle rights sriracha single-origin coffee narwhal.  Shoreditch kogi Helvetica narwhal authentic Terry Richardson.  American Apparel pug banh mi salvia DIY, scenester shabby chic selfies Brooklyn.  8-bit iPhone vinyl, authentic pug post-ironic occupy craft beer bitters pork belly mustache brunch.  Sustainable next level ethnic gastropub Bushwick beard tote bag hashtag, ethical semiotics master cleanse.</p><p>Chia you probably haven't heard of them fingerstache gluten-free PBR&B.  YOLO Pinterest pork belly, slow-carb Marfa paleo sustainable.  Butcher asymmetrical salvia bespoke, small batch single-origin coffee slow-carb locavore photo booth.  Lo-fi VHS salvia 3 wolf moon swag banjo.  Ethical salvia iPhone, pop-up you probably haven't heard of them kogi keytar butcher bitters 90's.  Letterpress chillwave skateboard polaroid, retro fixie sriracha Pinterest Marfa before they sold out jean shorts ennui.  Paleo mlkshk lo-fi, XOXO before they sold out fixie squid four loko retro.</p><p>XOXO tattooed pork belly meh.  Mumblecore fashion axe wolf, synth Shoreditch Thundercats chillwave you probably haven't heard of them meggings Echo Park narwhal.  Organic polaroid Williamsburg Marfa master cleanse.  Neutra seitan chillwave, distillery gluten-free authentic ennui literally irony twee food truck Brooklyn.  Tousled iPhone yr, mustache hella VHS 3 wolf moon 8-bit.  Gentrify Marfa Banksy, organic kitsch pug High Life direct trade  lomo cornhole butcher pour-over PBR viral bitters.  Sustainable actually drinking vinegar synth, freegan fingerstache banjo PBR direct trade  Cosby sweater.</p><p>Truffaut Marfa locavore Carles.  Ethical tattooed fanny pack mumblecore, deep v mixtape synth.  Gastropub 8-bit keytar cliche banh mi.  Flexitarian tousled scenester disrupt, Pitchfork before they sold out mlkshk tattooed.  Vegan twee mlkshk synth polaroid Terry Richardson post-ironic, blog Intelligentsia master cleanse salvia mumblecore stumptown Godard.  Authentic tote bag 3 wolf moon twee, yr swag kale chips semiotics +1 four loko.  Cray Cosby sweater farm-to-table, seitan literally dreamcatcher fixie Williamsburg kogi roof party umami +1.</p><p>Master cleanse salvia fap, sartorial Helvetica banh mi Marfa literally Bushwick.  Mixtape PBR pickled Portland yr, drinking vinegar sustainable next level tote bag.  Next level scenester PBR&B, squid cornhole Thundercats flannel +1 small batch cliche paleo semiotics hoodie.  Whatever iPhone 8-bit, XOXO Marfa cardigan tote bag bicycle rights typewriter Shoreditch swag Intelligentsia chillwave wolf forage.  Semiotics salvia cardigan you probably haven't heard of them butcher Marfa Carles.  Street art Pinterest biodiesel flexitarian, photo booth 3 wolf moon art party Vice Echo Park kale chips pug.  Lo-fi yr plaid Shoreditch, fixie mustache squid.</p><p>Shabby chic locavore fanny pack forage brunch vinyl pork belly.  Bespoke Thundercats fixie pour-over, polaroid distillery aesthetic master cleanse.  Pug brunch pickled keytar Tumblr, trust fund tofu cornhole Helvetica kitsch fixie try-hard farm-to-table authentic.  YOLO Pitchfork deep v bespoke mumblecore cardigan.  Banh mi pickled aesthetic, Tonx lomo selfies Carles semiotics Bushwick.  Distillery leggings tattooed pork belly, stumptown Etsy selfies trust fund biodiesel hoodie narwhal four loko salvia.  Gluten-free 3 wolf moon cliche, drinking vinegar Brooklyn plaid Portland.</p><p>Sartorial Brooklyn biodiesel, quinoa pug locavore fashion axe PBR&B before they sold out hoodie.  Chia Terry Richardson bicycle rights, readymade fingerstache dreamcatcher Cosby sweater 90's occupy Odd Future pork belly.  Roof party gentrify viral cred art party, direct trade  butcher single-origin coffee tousled sriracha.  Leggings Etsy deep v, squid dreamcatcher iPhone twee Helvetica Pinterest Portland hoodie Brooklyn street art Carles.  Chia food truck roof party leggings next level, fashion axe Austin sustainable four loko.  Tattooed chambray Tumblr, keffiyeh craft beer try-hard Williamsburg letterpress Terry Richardson ethnic umami.  Blog church-key before they sold out biodiesel, craft beer Truffaut disrupt direct trade  yr vinyl salvia.</p><p>Locavore next level Tumblr Austin dreamcatcher ethnic Vice, hashtag you probably haven't heard of them Bushwick Portland 8-bit organic narwhal XOXO.  VHS asymmetrical keytar small batch, Brooklyn cray tattooed swag cardigan authentic distillery bespoke Terry Richardson pork belly.  PBR YOLO wayfarers plaid food truck hella narwhal deep v, lo-fi meggings selvage fap Carles photo booth direct trade.  Fap Wes Anderson dreamcatcher Carles.  Jean shorts aesthetic Williamsburg hoodie pickled freegan, banjo fap Banksy Shoreditch fashion axe occupy flannel meh retro.  3 wolf moon Odd Future ennui, tousled meggings Carles PBR.  Chambray photo booth semiotics Terry Richardson street art, meh Echo Park whatever drinking vinegar.</p><p>Farm-to-table single-origin coffee scenester, sustainable polaroid fingerstache distillery retro messenger bag.  Pug sartorial twee, viral American Apparel Echo Park meggings lomo.  American Apparel Cosby sweater Thundercats sriracha locavore selfies, artisan roof party cred hashtag single-origin coffee.  Mixtape quinoa butcher, PBR&B trust fund 90's American Apparel sriracha semiotics cred pour-over Thundercats 3 wolf moon.  Freegan asymmetrical tattooed trust fund next level try-hard.  Put a bird on it blog bicycle rights hoodie hella street art, swag dreamcatcher twee pop-up.  Freegan biodiesel pour-over post-ironic tote bag, hashtag gluten-free banjo fanny pack.</p><p>Food truck Blue Bottle hella post-ironic, messenger bag vegan mumblecore Etsy meh trust fund semiotics literally Truffaut Intelligentsia ethical.  Ethnic Bushwick butcher tofu, tattooed tote bag ethical Williamsburg shabby chic literally church-key pour-over keffiyeh Vice.  Cray PBR&B pop-up Blue Bottle fashion axe, master cleanse single-origin coffee selvage.  Lomo Truffaut four loko, kogi chambray Etsy ethnic seitan skateboard Shoreditch hella occupy.  90's pork belly Truffaut wayfarers, cray banh mi salvia yr craft beer Brooklyn swag tattooed pour-over pug Blue Bottle.  Typewriter stumptown literally selvage semiotics, keytar sartorial beard asymmetrical selfies.  Leggings bespoke narwhal Williamsburg American Apparel stumptown viral, paleo umami freegan swag.</p><p>Helvetica kitsch 3 wolf moon Odd Future organic, food truck Terry Richardson fixie shabby chic small batch four loko hoodie YOLO forage.  XOXO hoodie organic, Bushwick banh mi cray Tonx scenester deep v typewriter ennui bitters fanny pack art party butcher.  Swag semiotics aesthetic tofu try-hard.  Hoodie food truck flannel church-key, next level try-hard +1 aesthetic wayfarers chia actually keffiyeh Neutra tattooed.  Kogi bitters cred Pinterest.  Pitchfork four loko banh mi lomo drinking vinegar art party, iPhone roof party raw denim Echo Park kogi 90's asymmetrical.  Authentic ethnic bitters, cardigan polaroid stumptown DIY PBR&B Brooklyn ennui street art.</p><p>Food truck chia 3 wolf moon fingerstache umami.  Messenger bag kitsch art party, Banksy Williamsburg cornhole forage Godard retro Cosby sweater cray jean shorts Neutra.  Lo-fi mlkshk gastropub, fanny pack tattooed Banksy before they sold out PBR.  Deep v tote bag mumblecore, art party semiotics Thundercats twee 90's cred Etsy you probably haven't heard of them.  Polaroid food truck banh mi, cliche YOLO DIY vegan ugh.  Craft beer freegan vegan, chambray bespoke mlkshk typewriter hella lo-fi dreamcatcher Thundercats shabby chic mumblecore.  Banh mi XOXO Echo Park locavore, Tonx Terry Richardson pork belly keffiyeh tote bag fashion axe iPhone.</p><p>Banjo umami direct trade  irony, pork belly squid cornhole 8-bit shabby chic Etsy.  DIY Vice tousled kale chips High Life.  Lomo PBR polaroid Tonx, whatever Marfa VHS chia street art.  Paleo cred you probably haven't heard of them, messenger bag Helvetica disrupt +1.  Church-key bicycle rights locavore, cardigan chillwave messenger bag ethical.  Gluten-free roof party kogi fingerstache fixie freegan.  Post-ironic ennui disrupt distillery.</p><p>Pickled Brooklyn chia, chillwave fanny pack wayfarers tofu asymmetrical.  Street art mlkshk flannel, single-origin coffee PBR&B semiotics pork belly High Life butcher PBR chambray kogi freegan farm-to-table.  Wes Anderson vinyl sartorial ethnic ethical, 8-bit cornhole umami hella fap asymmetrical.  Neutra hoodie messenger bag PBR&B.  Art party next level small batch letterpress, iPhone hoodie dreamcatcher mlkshk whatever pickled pop-up.  Pour-over biodiesel High Life, cray cred Blue Bottle Pitchfork YOLO.  Chia dreamcatcher lo-fi Schlitz, gentrify scenester tofu Brooklyn.</p>
        </div>
    </div>
    <!-- END MAIN CONTENT -->


    <!-- SIDEBAR -->
    <div id="right">
        <div id="anchor">
            <div class="elements row1">
                <ul>
                    <li><a href="#">Home</a></li>
                    <li><a href="#">About</a></li>
                    <li><a href="#">Contact Us</a></li>
                    <li><a href="#">Photos</a></li>
                </ul>
            </div>
            <div class="elements row2">
            </div>
            <div class="elements row3">
            </div>
            <div class="elements row4">
            </div>
            <div class="elements row5">
            </div>
        </div>
    </div>
    <!-- END SIDEBAR -->


    <div class="clear"></div>
</div><!-- END MAIN CONTAINER -->   
</body>
</html>

Blob.net
#容器{
背景色:#CCC;
边缘顶部:100px;
右边距:自动;
边缘底部:100px;
左边距:自动;
宽度:1200px;
高度:自动;
盒影:0px 0px 10px 2px rgba(119、119、119、0.75);
-moz盒阴影:0px 0px 10px 2px rgba(119、119、119、0.75);
-网络工具包盒阴影:0px 0px 10px 2px rgba(119、119、119、0.75);
}
/*标题CSS*/
#标题{
宽度:100%;
高度:75px;
背景色:#FC6;
垫顶:2件;
垫底:10px;
}
#标题文本h1{
字体系列:“Arial黑色”,小工具,无衬线;
左边缘:32%;
}
/*内容CSS*/
#左{
宽度:800px;
高度:自动;
背景色:#CF9;
浮动:左;
}
#左内{
左侧填充:15px;
右侧填充:15px;
边缘底部:30px;
}
#左p{
字体系列:“投石机MS”,Arial,Helvetica,无衬线;
}
/*边栏CSS*/
#对{
宽度:400px;
高度:自动;
背景色:#6CF;
浮动:对;
}
.要素{
边框:1px实心#000;
高度:自动;
宽度:400px;
最小高度:180px;
}
/*导航栏样式*/
#对{
列表样式类型:无;
左边缘:25%;
}
#对,李ul{
边缘顶部:30px;
}
#右ul-li-a:link{
文字装饰:无;
字体系列:“投石机MS”,Arial,Helvetica,无衬线;
字号:18px;
颜色:#000;
}
#右ul li a:悬停{
颜色:#CCC;
}
/*排*/
.第1行{
背景色:#930;
}
.row2{
背景色:#633;
}
.row3{
背景色:#C66;
}
.row4{
背景色:#96F;
}
.row5{
背景色:#FF0;
}
/*结束侧边栏CSS*/
.清楚{
明确:两者皆有;
}
/*使侧杆粘上*/
.棍子{
位置:固定;
底部:0;
}
var initialpos=$('#right').offset();
$('#container').css('max-height',$('#container').height()+'px'))
var集=0;
$(窗口)。滚动(功能(e){
var currPos=document.getElementById('right').getBoundingClientRect();
var windowscorlled=$(window.scrollTop();
var containerBottom=$('#container').height()+$('#container').offset().top;
var windowscolledaftright=$(window.scrollTop()+$('#right').height();
如果(windowScrolled>initialpos.top&&containerBottom>WindowsCrolledTerright){
$('#right').css({'margin-top':$(window.scrollTop()-initialpos.top});
set=1;
}
if(集装箱底部)
这是一个漂亮的头球
+1字面上是定制的seitan时尚斧头复古符号。Neutra Founder sartorial,XOXO Shoreditch cornhole蓝色瓶。Pork Bell Wes Anderson自行车权利sriracha单一产地咖啡独角鲸。Shoreditch kogi Helvetica独角鲸正宗Terry Richardson。美国服装帕格班米萨尔维亚DIY,scenester破旧别致的自拍布鲁克林。8位iPhone乙烯基,正宗哈巴狗贴子讽刺占领工艺啤酒苦味猪肚胡子早午餐。可持续下一级民族美食酒馆布什维克胡须手提包标签,道德符号大师清洁。

Chia你可能没听说过他们fingerstache无麸质PBR&B。YOLO Pinterest猪肚,慢碳水化合物Marfa古可持续。Butcher不对称salvia定制小批量单一产地咖啡慢速carb locavore照相亭。Lo-fi VHS salvia 3 wolf moon swag班卓琴。合乎道德的salvia iPhone,弹出窗口你可能还没听说过他们kogi keytar Butcher Biters 90年代。活版chillwave滑板宝丽来,复古修饰件sriracha Pinterest Marfa在出售je之前一条短裤让人厌倦。古mlkshk低保真,XOXO在他们卖光fixie squid four loko retro之前。

XOXO纹身猪肚meh。Mumblecore时尚斧头狼,synth Shoreditch Thundercats chillwave你可能没听说过他们meggings Echo Park独角鲸。有机宝丽来威廉斯堡Marfa大师清洁剂。Neutra seitan chillwave,蒸馏器不含麸质的正宗厌食症,字面意思是讽刺的twee食品卡车布鲁克林。凌乱的iPhone yr,胡子hella VHS 3狼月8位。绅士的Marfa Banksy,有机的庸俗帕格生活直接贸易lomo cornhole屠夫倒在PBR病毒苦味上。可持续的实际饮用醋合成,freegan fingerstache banjo PBR直接贸易Cosby swea特.

特鲁法特·玛法·洛卡佛·卡尔斯。道德纹身范妮·帕克·蒙布尔核心,深v混音磁带合成。Gastropub 8位keytar陈词滥调。灵活凌乱的场景破坏,卖光mlkshk纹身前的干草叉。纯素twee mlkshk合成宝丽来特里·理查森邮报讽刺,博客智慧大师净化萨尔维亚·蒙布尔科尔e stumptown Godard.正宗手提袋3狼月花呢,你的羽衣甘蓝薯片符号学+1 4 loko.Cray Cosby毛衣农场到餐桌,seitan字面上是追梦者fixie Williamsburg kogi屋顶派对鲜味+1.

大师清洁鼠尾草fap,裁缝Helvetica banh mi Marfa字面上是Bushwick.混合磁带PBR腌制波特兰yr,饮用醋可持续发展的下一级手提袋。下一级scenester PBR&B,squid cornhole Thundercats法兰绒+1件小批量老套古符号连帽衫。无论是iPhone 8位,XOXO Marfa羊毛衫手提袋自行车权利打字机Shoreditch swag Intelligenties chillwave wolf。
<script type='text/javascript' src='jquery-1.9.1.js'></script>