复选框图像替换,没有任何反复

时间:2010-08-28 19:10:41

标签: javascript jquery

<?php 
//require 'includes/db.inc.php';
require 'includes/configs.inc.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title><?php $site_name ?></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
        <link rel="stylesheet" type="text/css" href="/css/style.css">
        <script type="text/javascript" src="/js/jquery.imageTickBox.js"></script>
        <script type="text/javascript">
        jQuery(document).ready(function(){
            jQuery("input:[type=checkbox]").imageTickBox({
            tickedImage: "/images/checked.png",
            unTickedImage: "/images/unchecked.png",
            imageClass: "tickbox"
            });
            });
            </script>
  </head>
    <body>
      <div id="mirror" class="center">
        <!--some code deleted-->
        <input type="checkbox" id="Music" name="hobbies[]" value="Music">
        <!--some code deleted-->
      </div>
  </body>
</html>

上面代码的任何错误???? name index.php并将其放在root目录上。

但不行,我在

看到了jquery复选框插件指南

http://blog.leenix.co.uk/2009/10/jquery-plugin-imagetickbox-change-any.html

2 个答案:

答案 0 :(得分:1)

即使使用外部资源,也要关闭脚本标记。

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

答案 1 :(得分:1)

您需要关闭jquery脚本标记:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>