内联SVG在Tumblr上打破JavaScript /无限滚动

时间:2014-08-04 15:20:13

标签: javascript jquery css svg tumblr

我刚刚在我的tumblr-blog上插入了一个徽标作为内联SVG,不知怎的,因此,无限滚动停止工作。

Tbis是图形的代码(插入 body 标记之后):

        <div id="title">
    <h1><a href="{BlogURL}" title="{lang:Home}">
        <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="300px" height="379px" viewBox="0 0 300 370" enable-background="new 0 0 300 370" xml:space="preserve" class="title-svg">
        <g class="cross" opacity="0.7" fill="none" stroke="{color:Hovered Links}" stroke-width="5">
        <line stroke-miterlimit="10" x1="294.928" y1="331" x2="6.99" y2="43.001"/>
        <line stroke-miterlimit="10" x1="6.99" y1="331" x2="294.928" y2="43.001"/>
        </g>
        <g class="characters" opacity="0.7" fill="{color:Links}">
        <path d="[loads of vector data]"/>
        <path d="[more vector data]"/>
        </g>
        </svg>
    </a></h1>
    </div>

这是 body 结束标记之前的Javascript:

    <script type="text/javascript" src="http://codysherman.tumblr.com/tools/infinite-scrolling/code"></script>
    <script src="http://static.tumblr.com/1c0fvbc/1PUn7oow3/jquery.photoset-grid.js"></script>
    <script type"text/javascript">
        XMLHttpRequest.prototype.originalSend=XMLHttpRequest.prototype.send;
        XMLHttpRequest.prototype.send=function(s){
            this.addEventListener('load',function(){
                        $('.photoset-grid').photosetGrid({
                            gutter: '5px',
                            highresLinks: true,
                            onInit: function(){},
                            onComplete: function(){
                            $('.photoset-grid').photosetGrid();}
                        })                },false);
            this.originalSend(s);
        }
    </script>
    <script type"text/javascript">
        $('.photoset-grid').photosetGrid({
            gutter: '5px',
            highresLinks: true,
            onInit: function(){},
            onComplete: function(){
            $('.photoset-grid').photosetGrid();}
        })
    </script>

我完全不知道为什么这会破坏我正在使用的Javascript。此外, Photoset-Grid 的Javascript仍然有效。有谁能告诉我出了什么问题?

0 个答案:

没有答案