C# 无法运行jquery fiddle代码

C# 无法运行jquery fiddle代码,c#,jquery,imagemapster,C#,Jquery,Imagemapster,伙计们,我试图在我本地的asp.net页面上用小提琴运行代码,但它对我不起作用。请看我哪里出错了。我无法在我的页面上获得悬停效果 我不确定是否包含了必要的jquery文件 fiddle url: 我的代码: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="EPaperWeb.WebForm1" %> <!DOCTYPE html PUBLIC "-//W

伙计们,我试图在我本地的asp.net页面上用小提琴运行代码,但它对我不起作用。请看我哪里出错了。我无法在我的页面上获得悬停效果


我不确定是否包含了必要的jquery文件

fiddle url:

我的代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="EPaperWeb.WebForm1" %>

<!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 runat="server">
    <title></title>




    <script type ="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
    <script type ="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
    <script type="text/javascript">
        $('#mapimage').mapster(
    {
        fillColor: 'ff0000'
    }); </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <img id="mapimage" src="http://www.groupswelcome.co.uk/maps/uk_map.gif" usemap="#map"
            type="image/png" title="Join your local network"></div>
    <map id="map" name="map">
        <area shape="poly" id="northern" alt="Northern" title="Northern" coords="123,248,134,271,139,294,141,301,156,321,167,317,183,307,180,288,188,298,205,302,225,290,239,289,248,274,211,229,199,208,176,170,168,170,148,207,123,238"
            href="#" target="" />
        <area id="wales" shape="poly" alt="Wales" title="Wales" coords="100,302,92,332,110,338,111,355,64,374,88,400,133,398,154,404,164,384,161,372,144,364,145,344,154,321,143,302,103,293"
            href="#" target="" />
        <area id="westmidlands" shape="poly" alt="West Midlands" title="West Midlands" coords="181,368,195,360,206,351,189,326,182,305,149,321,142,358,147,369,163,376"
            href="#" target="" />
        <area id="eastmidlands" shape="poly" alt="East Midlands" title="East Midlands" coords="215,365,233,341,233,328,254,320,238,284,210,293,192,304,177,290,184,320,204,353,203,366"
            href="#" target="" />
        <area id="london" shape="poly" alt="London" title="London" coords="227,385,235,398,244,402,255,391,259,384,239,379,230,383"
            href="#" target="" />
        <area id="east" shape="poly" alt="East" title="East" coords="260,315,287,316,288,364,271,389,259,390,246,377,225,382,222,368,217,357,235,327"
            href="#" target="" />
        <area id="southwest" shape="poly" alt="South West" title="South West" coords="61,468,88,475,104,456,139,462,153,437,180,441,192,436,196,396,188,363,162,375,152,405,142,404,109,408,87,440"
            href="#" target="" />
        <area id="southeast" shape="poly" alt="South East" title="South East" coords="209,445,224,429,259,429,284,409,276,386,254,391,241,405,226,388,215,363,194,369,199,401,192,436"
            href="#" target="" />
        <area id="northernireland" shape="poly" alt="Northern Ireland" title="Northern Ireland"
            coords="46,270,56,267,81,244,58,215,33,203,1,237,0,252,9,268" href="#" target="" />
    </map>
    </form>
</body>
</html>

$('#mapimage').mapster(
{
fillColor:'ff0000'
}); 

$(文档).ready(函数(){
$('#mapimage').mapster(
{
fillColor:'ff0000'
});
});

我看不出您在哪里包含了jquery mapster插件

在脚本部分中应该有类似的内容:

<script type ="text/javascript" src="~/path/to/scripts/jquery.imagemapster.js"></script>
打开,如果看到左平移:

表示jquery的
ready()

$(document).ready(function() {
   //all code here
});

$(“#ImgMap”)
应该是
$(“#mapimage”)
?我在发帖时使用了相同的was错误。我不确定是否包含了必要的jquery文件。开始使用firebug(firefox)、ctrl-shift-i(chrome)等web开发工具。。。他们会向你展示更多关于加载内容的信息,以及你的js中的错误,我看到了悬停效果。我不确定是否包含了必要的jquery文件。您需要添加
jquery
作为第一个脚本参考,然后添加
jquery ui
,最重要的是,您需要下载
imagemapster
脚本文件并添加脚本链接作为我的答案,但小提琴上没有类似的内容。你能告诉我在哪里可以得到这个插件吗?请看工作提琴。该代码包含在提琴中,在“外部资源”选项卡下(在左边的菜单中)。看起来你可以从中获得插件。如果你点击JSFIDLE中的“外部资源”,你会看到一个指向jquery.imagemapster.js.Thx erwin的链接……还有Thx prmech,希望你能提供帮助……但是我还有一个问题,那就是当点击热点时,它的颜色会变红,直到重新加载页面为止。我想在点击热点并将鼠标从热点移开后,它应该保持其初始状态,即,它不应该有任何颜色。
$(document).ready(function() {
    $('#mapimage').mapster({
        fillColor: 'ff0000'
    });
});
$(document).ready(function() {
   //all code here
});