Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/443.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 三明治按钮和响应性设计_Javascript_Jquery_Web_Header_Responsive - Fatal编程技术网

Javascript 三明治按钮和响应性设计

Javascript 三明治按钮和响应性设计,javascript,jquery,web,header,responsive,Javascript,Jquery,Web,Header,Responsive,我需要你的帮助。请看一下我的代码,告诉我出了什么问题,因为我的三明治按钮坏了。这是我的HTML: <div id="header"> <div> <!--here is my sandwich button !--> <img class="nav_menu" src="/templates/shablon/images/menu_button.png" alt="button" border="0" />

我需要你的帮助。请看一下我的代码,告诉我出了什么问题,因为我的三明治按钮坏了。这是我的HTML:

<div id="header">
    <div>
        <!--here is my sandwich button !-->
        <img class="nav_menu" src="/templates/shablon/images/menu_button.png" alt="button" border="0" />
    </div>
    <div>
        <!--Here is cross button to close the sandwich button!-->
        <img class="nav_close" src="templates/shablon/images/menu_close.png" alt="cross_button" />
    </div>
    <div id="top_menu_outer">
        <div id="header_inner">
            <div id="top_menu">
                <jdoc:include type="modules" name="top_menu" style="xhtml" />
            </div>

您需要更具体地说明什么不起作用,什么不起作用?请输入完整的html代码。@Knitesh不是完整的代码,而是一个。我们不需要所有东西,只需要与问题相关的东西。@evolutionxbox perfect..您的
$(“img.only\u mobile.nav\u close”)中的
.only\u mobile
是什么
$(document).ready(function() {
    $("img.nav_menu").click(function() {
        $('#top_menu_outer').addClass("_opened");
    });
    $("img.only_mobile.nav_close ").click(function() {
        $('#top_menu_outer').removeClass("_opened");
    });
    var buttonUp = $('#up-button');
    var currentScrollTop = 0;
    $(window).scroll(function(e) {
        currentScrollTop = $(window).scrollTop();
        if (currentScrollTop >= 200) {
            buttonUp.fadeIn(1000);
        } else {
            buttonUp.fadeOut(1000);
        }
    });

    buttonUp.click(function(e) {
        e.preventDefault();

        $('html, body').animate({
            scrollTop: 0
        });
    });