Snippet - jQuery script inclusion
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<title>jQuery Sample</title>
<style type="text/css">
body { font-family: Arial; font-size: 16px; }
dl { width: 300px; }
dl,dd { margin: 0; }
dt { background: #00f; font-size: 18px; padding: 5px; margin: 2px; }
dt a { color: #FFF; }
dd a { color: #000; }
ul { list-style: none; padding: 5px; }
</style>
</head>
<body>
<dl>
<dt><a href="#">Very Touristy Things</a></dt>
<dd>
<ul>
<li><a href="https://www.getty.edu/museum/">J. Paul Getty Center</a></li>
<li><a href="https://www.sixtaste.com/">6 Taste</a></li>
<li><a href="https://www.hollywoodsign.org/">Hollywood Sign</a></li>
</ul>
</dd>
<dt><a href="#">Day Trips</a></dt>
<dd>
<ul>
<li><a href="https://www.laparks.org/venice/enter.htm">Venice Beach Boardwalk</a></li>
<li><a href="https://www.dearlydepartedtours.com/">Dearly Departed</a></li>
<li><a href="https://www.ocwildlifebeachtour.com">OC and Wildlife tour</a></li>
</ul>
</dd>
<dt><a href="#">Hollywood-ish</a></dt>
<dd>
<ul>
<li><a href="https://manntheatres.com">Chinese Theatre</a></li>
<li><a href="https://en.wikipedia.org/wiki/Chateau_Marmont">Chateau Marmont</a></li>
</ul>
</dd>
</dl>
<script type="text/javascript"
src="https://ajax.microsoft.com/ajax/jQuery/jquery-1.4.1.js"></script> 1: 2: 3: <script type="text/javascript"> 4: 5: // Once the DOM is loaded, then we are ready.... 6: $(document).ready(function () { 7: 8: // Hide all but the first <dd> 9: $("dd:not(:first)").hide(); 10: 11: $("dt a").click(function (e) { 12: e.preventDefault(); 13: 14: // Hide what is visible. Do a "slideup" 15: $("dd:visible").slideUp("slow"); 16: 17: // Now to slide down the clicked on link 18: $(this).parent().next().slideDown("slow"); 19: }); 20: }); 21: 22: </script>
</body>
</html>
<script type="text/javascript"
src="https://ajax.microsoft.com/ajax/jQuery/jquery-1.4.1.js"></script>
|