Skip to main content

Posts

Showing posts with the label toggle function in jquery

toggle function in jquery

toggle function : toggle function are used cin jQuery 1.8 toogle attach two or more function to toggle between the click event for selected element. When first time click on element then first function call then again second time click another function call. Syntax : $(element).toggle(function); Demo link : http://freeteachnology.hol.es/toggle/ Code link : https://drive.google.com/open?id=0BxmTZPVcu72fVExPWXRkSHRXbnM if without toogle follwoing function you can use : Without toogle : <script> if(display==true) { $(“#name”).show(); }else if(display==false) { $(“#name”).hide(); } </script> Using toggle : <script> $(“#name”).toggle(); </script> Following file structure create : 1-header.php, 2-footer.php, 3-index.php, 1-header.php file include bootstrap links well as jquery link, Code : <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Co...