Commits

Alexander Dahl  committed 5fc1446 Draft

css class add/remove test

  • Participants
  • Parent commits 912d0d4

Comments (0)

Files changed (3)

File page115.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
+<head>
+    <title>title</title>
+    <link rel="stylesheet" type="text/css" href="styles/page115.css" />
+</head>
+<body>
+    <div id="header" class="no_hover"><h1>Header</h1></div>
+    <button type="button" id="btn1">Click to Add</button>
+    <button type="button" id="btn2">Click to Remove</button>
+    <script src="scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
+    <script type="text/javascript" src="scripts/page115.js"></script>
+</body>
+</html>

File scripts/page115.js

+jQuery(document).ready(function(){
+    $("#btn1").click(function(){
+        $("#header").addClass("hover");
+        $("#header").removeClass("no_hover");
+    });
+    $("#btn2").click(function(){
+        $("#header").removeClass("hover");
+        $("#header").addClass("no_hover");
+    });
+});

File styles/page115.css

+.hover {
+    border: solid #f00 3px;
+}
+
+.no_hover {
+    border: solid #000 3px;
+}