私は暗い側に表示されているように、可動側のアクションで切り替えボタンを作成したいと思います。どのようにこれを書くことができるかを体は助けることができる 。jQueryで切り替えボタンを作成するには
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".styleswitch").click(function() {
$('link[rel=stylesheet]').attr('href' , $(this).attr('rel'));
});
});
</script>
<link rel="stylesheet" type="text/css" href="css/dark.css" />
<title>Switch Theme</title>
</head>
<body>
<a href="#" class="styleswitch" rel="css/dark.css">Dark</a>
<a href="#" class=" styleswitch " rel="css/light.css">Light</a>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
<div id="module-a"><a href="#" class="styleswitch" rel="css/dark.css">Dark</a>
<a href="#" class=" styleswitch " rel="css/light.css">Light</a></div>
<div id="module-b">Module1</div>
<div id="module-c">Module1</div>
<div id="module-d">Module1</div>
</body>
</html>
あなたはこれまで何をしていますか?いくつかのコードを表示... – jackJoe