Skip to main content
added language tag
Source Link
Quill
  • 12.1k
  • 5
  • 41
  • 94

The following responsive navigation on JSfiddle works well, however I am just wondering whether there is any way to improve what I have done. I am new at JQuery so all help appreciated: JSFiddle here

$(document).ready(function () {
    $(".menu").click(function () {
        $('#menu').animate({
            'left': '0px'
        });
    });
    $("#close").click(function () {
        $('#menu').animate({
            'left': '-100px'
        });
    });
    $(".menu").click(function () {
        $('#container').animate({
            'left': '100px'
        });
    });
    $("#close").click(function () {
        $('#container').animate({
            'left': '0px'
        });
    });
});

The following responsive navigation on JSfiddle works well, however I am just wondering whether there is any way to improve what I have done. I am new at JQuery so all help appreciated: JSFiddle here

$(document).ready(function () {
    $(".menu").click(function () {
        $('#menu').animate({
            'left': '0px'
        });
    });
    $("#close").click(function () {
        $('#menu').animate({
            'left': '-100px'
        });
    });
    $(".menu").click(function () {
        $('#container').animate({
            'left': '100px'
        });
    });
    $("#close").click(function () {
        $('#container').animate({
            'left': '0px'
        });
    });
});

The following responsive navigation on JSfiddle works well, however I am just wondering whether there is any way to improve what I have done. I am new at JQuery so all help appreciated: JSFiddle here

$(document).ready(function () {
    $(".menu").click(function () {
        $('#menu').animate({
            'left': '0px'
        });
    });
    $("#close").click(function () {
        $('#menu').animate({
            'left': '-100px'
        });
    });
    $(".menu").click(function () {
        $('#container').animate({
            'left': '100px'
        });
    });
    $("#close").click(function () {
        $('#container').animate({
            'left': '0px'
        });
    });
});
Tweeted twitter.com/#!/StackCodeReview/status/537307170791251968
Title and text
Source Link
rolfl
  • 98.1k
  • 17
  • 220
  • 419

Hi all I am new to Jquery and am wondering if there is a better way of doing the below. CC welcome Responsive Navigation

Hi all I have made aThe following responsive navigation on JSfiddle.

it works well;well, however I am just wondering whether there is anywayany way to improve what I have done. I am new at jqueryJQuery so all help appreciated: http://jsfiddle.net/kX7b6/1540/JSFiddle here

$(document).ready(function () {
    $(".menu").click(function () {
        $('#menu').animate({
            'left': '0px'
        });
    });
    $("#close").click(function () {
        $('#menu').animate({
            'left': '-100px'
        });
    });
    $(".menu").click(function () {
        $('#container').animate({
            'left': '100px'
        });
    });
    $("#close").click(function () {
        $('#container').animate({
            'left': '0px'
        });
    });
});

});

Hi all I am new to Jquery and am wondering if there is a better way of doing the below. CC welcome

Hi all I have made a responsive navigation on JSfiddle.

it works well; however I am just wondering whether there is anyway to improve what I have done. I am new at jquery so all help appreciated http://jsfiddle.net/kX7b6/1540/

$(document).ready(function () {
$(".menu").click(function () {
    $('#menu').animate({
        'left': '0px'
    });
});
$("#close").click(function () {
    $('#menu').animate({
        'left': '-100px'
    });
});
$(".menu").click(function () {
    $('#container').animate({
        'left': '100px'
    });
});
$("#close").click(function () {
    $('#container').animate({
        'left': '0px'
    });
});

});

Responsive Navigation

The following responsive navigation on JSfiddle works well, however I am just wondering whether there is any way to improve what I have done. I am new at JQuery so all help appreciated: JSFiddle here

$(document).ready(function () {
    $(".menu").click(function () {
        $('#menu').animate({
            'left': '0px'
        });
    });
    $("#close").click(function () {
        $('#menu').animate({
            'left': '-100px'
        });
    });
    $(".menu").click(function () {
        $('#container').animate({
            'left': '100px'
        });
    });
    $("#close").click(function () {
        $('#container').animate({
            'left': '0px'
        });
    });
});
Source Link

Hi all I am new to Jquery and am wondering if there is a better way of doing the below. CC welcome

Hi all I have made a responsive navigation on JSfiddle.

it works well; however I am just wondering whether there is anyway to improve what I have done. I am new at jquery so all help appreciated http://jsfiddle.net/kX7b6/1540/

$(document).ready(function () {
$(".menu").click(function () {
    $('#menu').animate({
        'left': '0px'
    });
});
$("#close").click(function () {
    $('#menu').animate({
        'left': '-100px'
    });
});
$(".menu").click(function () {
    $('#container').animate({
        'left': '100px'
    });
});
$("#close").click(function () {
    $('#container').animate({
        'left': '0px'
    });
});

});