OSDN Git Service

rotate used
authoryamat0jp <yamat0jp@yahoo.co.jp>
Sat, 10 Dec 2016 12:10:50 +0000 (21:10 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Sat, 10 Dec 2016 12:10:50 +0000 (21:10 +0900)
I had mani bad commit sorry

pybbs/title.htm
static/js/main.js [new file with mode: 0644]

index 781e9ef..fa29ea4 100644 (file)
@@ -9,30 +9,17 @@
 </style>
 <script src=static/js/jquery-1.10.2.min.js></script>
 <script src=static/js/jquery-ui-1.10.3.custom.min.js></script>
-<script>var arg = {
-       'font-size':'2em',
-       'transform':'rotate(10deg)'
-};</script>
+<script src=static/js/main.js></script>
 </head>
 <body>
 {% for x in coll %}
-       <article>
        {% if full(x['name']) == True %}
        <a href=/{{x['name']}}> style=color:red>{{x['name']}}</a>
        {% else %}
        <a href=/{{x['name']}}>{{x['name']}}</a>
        {% end %}
-       <span id={{x['name']}}><span class=g1>タイトル:</span>{{x['title']}}<span class=g1>,記事数:</span>{{x['count']}}<span class=g1>,更新時刻:</span>{{x['date']}}</span>
-       <script>
-       $(function(){
-               $('#{{x['name']}}').on('click',function(){
-                       $(this).css(arg);
-               })
-               .on('mouseout',function(){
-                       $(this).css('font-size','1em');
-               });
-       });
-       </script></article>
+       ↓
+       <div><span class=g1>タイトル:</span>{{x['title']}}<span class=g1>,記事数:</span>{{x['count']}}<span class=g1>,更新時刻:</span>{{x['date']}}</div>
        <p>
 {% end %}
 <p><a href=/>もどる</a>
diff --git a/static/js/main.js b/static/js/main.js
new file mode 100644 (file)
index 0000000..e44ef7f
--- /dev/null
@@ -0,0 +1,18 @@
+var
+arg = {
+       'font-size':'2em',
+       'transform':'rotate(5deg)'
+};
+narg = {
+       'font-size':'initial',
+       'transform':'initial'
+};
+
+$(function(){
+       $('div').on('click',function(){
+               $(this).css(arg);
+       })
+       .on('mouseout',function(){
+               $(this).css(narg);
+       });
+});
\ No newline at end of file