Varvara Jones Varvara Jones - 2 months ago 5
Javascript Question

Stop jQuery toggle from sliding content in

I am using a simple jQuery .toggle hoping it would show/hide my content on click. It does that but my content always slides in from left to right until it's where it should be. I don't want it to slide in. Is there a better jQuery method for this or a property I need to specify?

Thanks! This is the jQuery code I'm using:

$(document).ready(
function(){
$('.img-lg').click(function () {
$('.content').toggle("slow");
});
}
);

Answer

Change $('.content').toggle("slow") to $('.content').toggle(). This will remove the transition