Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

with jquery Make a style menu that displays paragraphs and hides them according to the style of the slides

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>toggle demo</title>
  <style>
  p {
    background: #dad;
    font-weight: bold;
    font-size: 16px;
  }
  </style>
  <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>
 
<button>Toggle 'em</button>
<p>Hiya</p>
<p>Such interesting text, eh?</p>
 
<script>
$( "button" ).click(function() {
  $( "p" ).toggle( "slow" );
});
</script>
 
</body>
</html>
Source by api.jquery.com #
 
PREVIOUS NEXT
Tagged: #jquery #Make #style #menu #displays #paragraphs #hides #style #slides
ADD COMMENT
Topic
Name
2+7 =