user1505573
user1505573

Reputation: 137

Troubleshooting Jquery Show/Hide With Nested Divs

I've managed to get this working with:

<!--
function resettoggle() {
document.getElementById('imagecarousel').style.display = 'none';

}

function displayImages() {
                document.getElementById$('#imagecarousel').style.display="block";

            }

  $('#imagecarousel').fadeIn("slow", function() {
  // Animation complete


    $('#portfolio').click(function () {
  $("#imagecarousel").toggle();


});
});

-->

and adding onLoad="resettoggle()" to the body tag

I now only need help with 2 things:

  1. I have the div set to fadeIn, but it seems to be flying in at the speed of light.

  2. When the page loads, you see a flicker of the slideshow before it disappears. Not sure how to implement the resettoggle function in a way that keeps the hidden div completely out of view?

Upvotes: 1

Views: 317

Answers (1)

Ram
Ram

Reputation: 144709

you can use fadeToggle():

Display or hide the matched elements by animating their opacity.

$("#portfolio").click(function () {
   $("#imagecarousel").fadeToggle("slow");
});

Upvotes: 2

Related Questions