We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15675
    • 11 Posts
    すいません。javascriptエラーでした・・・・

    というより使用したいスクリプトなのですが
    http://jquery.com/のページにあるダウンメニューです。

    なにかよい方法はないでしょうか。

    バージョンは確認中です。
      • 6158
      • 224 Posts
      テンプレートを以下のように、

      Template code

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <base href="[(site_url)]" />
      <script src="assets/js/jquery.js" type="text/javascript"></script>
      <script type=’text/javascript’>
      function showHello () {
      $(’div.hello’).addClass (’world’).show (’slow’);
      }
      </script>
      <title></title>
      </head>
      <body>
      [*content*]
      </body>
      </html>

      ドキュメントを以下のように、

      Document content

      <fieldset>
      <legend onclick="showHello ()" style="cursor:pointer">clickme</legend>
      <div class="hello" style="display:none">Hello, World</div>
      </fieldset>
      これでニョロニョロニョロと "Hello, World" が表示されました。

      jquery.js のドキュメントを読まずに「こんなもんだろ」と勝手に解釈して書
      いたので、間違っている部分があるかもしれません。確かめてください。

      p.s.
      ----
      もしかして、これを書いて欲しかったのかな?
      それで「有料」と書かれたのかな?