Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2011
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help With Jquery Show/Hide With Nested Divs

    Please see update
    Last edited by savagebeauty; 07-13-2012 at 12:48 AM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,303
    Thanks
    23
    Thanked 612 Times in 611 Posts
    Try this for the jquery:
    Code:
    <script type="text/javascript">
    $(document).ready(function() {
    	$("#portfolio").click(function(){
    		if ($("#imagecarousel").css("display") == "none"){
    			$("#imagecarousel").fadeIn("slow");
    		}else{
    			$("#imagecarousel").hide();
    		}
    	});
    });
    </script>

  • #3
    New Coder
    Join Date
    Jul 2011
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've managed to get this working with:

    Code:
    <script type="text/javascript" language="javascript" charset="utf-8">
    
    <!--
    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();
    	
    		
    });
    });
    
    -->
    </script>
    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?
    Last edited by savagebeauty; 07-13-2012 at 12:47 AM. Reason: update


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •