Dr. Morpheus Dr. Morpheus - 1 year ago 68
CSS Question

Jquery for CSS attribute change with ease and return on place again

I am trying to open left slidepanel here is the code

jQuery('.right_panel_handle').on('click',function() {
return false;

I am trying to change position on click with ease and upon click again it should return to its place.

Need help please!

Answer Source
jQuery('.right_panel_handle').on('click',function() {
    var panel = jQuery('.right_panel');
    if (panel.offset().left > $(window).width() - panel.width()){
        panel.css('right', '0px');
    } else {
        panel.css('right', - panel.width() + 'px');
    return false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download