非常简单的jQuery插件失败,控制台不显示错误

时间:2015-04-10 13:30:34

标签: javascript jquery html slicknav

我正在使用一个可以改变您的响应式导航的插件。我已经与其他网站一起使用并且效果很好: SlickNav jquery plugin

1)首先正确加载菜单 enter image description here

2)一秒后,仅显示HTML白色和菜单文字: enter image description here

Chrome和Firefox控制台不显示错误......所以一切正常。

当然,我正在使用正确版本的jQuery并且脚本已正确加载。

发生了什么事?

非常感谢。

这是我调用脚本的文件:

<!--[if lt IE 9]>
<script src="http://rp-static.com/common/js/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="http://rp-static.com/common/js/jquery_modules/jquery.js"></script>
<script type="text/javascript" src="http://rp-static.com/common/js/RP_Traductor.js?1.0"></script>
<script type="text/javascript" src="scripts/jquery.slicknav.min.js"></script>

<!-- Aviso navegador viejo -->
<!--[if lt IE 9]>
<script type="text/javascript" src="http://rp-static.com/common/js/noie6/noie6.js"></script>
<style>
.tabrow li{
    width:93px;
    float:left;
    padding-top:4px;
}
</style>
<![endif]-->

<script>
<? if ($dicc != ''){?>
var dicc = new Dicc();
dicc.init('<?=$dicc?>','<?=$_SESSION['lng']?>');
<? } ?>
$(document).ready(function()
{   

    $('img').bind("contextmenu",function(e){return false;}); 

    // This adds placeholder support to browsers that wouldn't otherwise support it. 
    jQuery(function() {
       jQuery.support.placeholder = false;
       test = document.createElement('input');
       if('placeholder' in test) jQuery.support.placeholder = true;
    });

    $(function() {
       if(!$.support.placeholder) { 
          var active = document.activeElement;
          $(':text').focus(function () {
             if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
                $(this).val('').removeClass('hasPlaceholder');
             }
          }).blur(function () {
             if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
                $(this).val($(this).attr('placeholder')).addClass('hasPlaceholder');
             }
          });
          $(':text').blur();
          $(active).focus();
          $('form:eq(0)').submit(function () {
             $(':text.hasPlaceholder').val('');
          });
       }
    });

    $('#btn_top_jessica').click(function(){
        $('html, body').animate({
            scrollTop: $(".barra_superior").offset().top
        }, 750); 
    });

        window.___gcfg = {lang: 'es'};

      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/platform.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
});
</script>

    <script>

    function setCookie(cname,cvalue,exdays){
        var d = new Date();
        d.setTime(d.getTime()+(exdays*24*60*60*1000));
        var expires = "expires="+d.toGMTString();
        document.cookie = cname + "=" + cvalue + "; " + expires+"; path=/";
    }

    function getCookie(c_name){
        var c_value = document.cookie;
        var c_start = c_value.indexOf(" " + c_name + "=");
        if (c_start == -1)
          c_start = c_value.indexOf(c_name + "=");

        if (c_start == -1)
          c_value = null;
        else
        {
            c_start = c_value.indexOf("=", c_start) + 1;
            var c_end = c_value.indexOf(";", c_start);
            if (c_end == -1)
                c_end = c_value.length;
            c_value = unescape(c_value.substring(c_start,c_end));
        }
        return c_value;
    }

    function acceptCookies(e) {
        setCookie("aviso_cookies","3",30); 
        e.parentNode.style.display="none";
    }

    $(window).load(function()
    {
        //Responsive Menu
//      $(function(){
//          $('.menu-responsive').slicknav();
//      });

        if (getCookie('aviso_cookies') == null || parseInt(getCookie('aviso_cookies')) < 3) {
            var aviso_cookies = getCookie('aviso_cookies') == null? 0 : parseInt(getCookie('aviso_cookies'))+1;
            setCookie('aviso_cookies',aviso_cookies,30);
            $('body').prepend('<div class="cookies_msg">Utilizamos cookies propias y de terceros para mejorar nuestros servicios, personalizar tu experiencia y optimizar nuestra publicidad. <br>Tienes toda la información en nuestra <a href="politica-de-cookies">política de cookies</a>: si continúas navegando, consideraremos que la aceptas. <span style="cursor:pointer;color:blue;text-decoration:underline;" onclick="javascript:acceptCookies(this);"> Cerrar </span></div>');
        }
    });

    </script>

<script type="text/javascript" src="http://rp-static.com/common/js/jquery_modules/memu/jquery.memu-0.1.min.js"></script>
<link href="http://rp-static.com/common/js/jquery_modules/memu/memu-0.1.css" rel="stylesheet" type="text/css">

响应式菜单调用是:

//Responsive Menu
        $(function(){
            $('.menu-responsive').slicknav();
        });

0 个答案:

没有答案