W3 Mind Logo
Home » Hide and show toggle – jQuery

Hide and show toggle – jQuery

Here is a basic example of Preloading the content on the webpages.

				
					<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("#my_toggle button").click(function(){
        $("#my_toggle div").slideToggle();
    });
});
</script>
</head>
<body>
<div id="my_toggle">
  <button>Toggle slideUp() and slideDown()</button>
  <div>This is a paragraph.</div>
</div>
</body>
</html>
				
			

Example:

This is a paragraph.
About Author
Picture of W3Mind

W3Mind

W3Mind focuses on Blogging, Make Money Online, SEO, Business Blogging, Social Media, WordPress, Internet Tools, Web Design and Development.
Give it a Share
Facebook
Twitter
LinkedIn
You May Also Like
How to
START A
BLOG
(step by step)
Load WordPress Sites in as fast as 37ms!