简体   繁体   English

客户端或服务器端(asp.net)图像映射都不会弹出html表单

[英]Neither client-side or server-side (asp.net) imagemap will popup html form

I have a sprite that when clicked it should open either an htm help file or video, depending on where clicked. 我有一个精灵,单击时应打开htm帮助文件或视频,具体取决于单击的位置。
I have tried asp.net image map and client side map, with and without the window.open and also sending to a javascript function. 我尝试过asp.net图像映射和客户端映射,无论是否有window.open并发送到javascript函数。 Nothing works. 什么都没有。 I really don't want to use server side, but I just can't seem to get this working. 我真的不想使用服务器端,但似乎无法正常工作。

<div class="divhelp">
  <br />
  <asp:ImageMap  
         ID="ImageMap1"  
         runat="server"  
         ImageUrl="~/images2020/SpriteVideoandHelp.png" 
         Width="70"  
         Height="32"
         HotSpotMode="NotSet">  
        <asp:RectangleHotSpot Target="_self" Top="0" Bottom="32" Left="0" Right="34" AlternateText="Videos" NavigateUrl="openVideoHelp('1')" />  
        <asp:RectangleHotSpot Target="_blank" Top="0" Bottom="32" Left="35" Right="70" AlternateText="Help" NavigateUrl="javascript:window.open('../HelpFiles/Login.htm', 'Search', 'width=600,height=450,left=150,top=200,scrollbars=1,toolbar=no,menubar=yes,status=1')" />  
    </asp:ImageMap>  
  </div>


<a href="#"><img src="images2020/SpriteVideoandHelp.png" alt="Videos and Help Files" width="70" height="32" border="0" usemap="#mapname"/></a><br />
  <map id="mapname">
    <area shape="rect" onclick="javascript:window.open('../HelpFiles/Login.htm','Search','width=650,height=500,left=150,top=200,scrollbars=1,toolbar=no,menubar=yes,status=1')" alt="Videos" coords="0,32,0,34"/>
    <area shape="rect" onclick="javascript:window.open('../HelpFiles/Login.htm','Search','width=650,height=500,left=150,top=200,scrollbars=1,toolbar=no,menubar=yes,status=1')" alt="Help" coords="0,32,35,70" />
</map>


    function openVideoHelp(imgClicked) {

    if (imgClicked == '1') {
        helpfile = window.open('../HelpFiles/Login.htm', 'Search', 'width=600,height=450,left=150,top=200,scrollbars=1,toolbar=no,menubar=yes,status=1');
        return false;
    }
    else {

        helpfile = window.open('../HelpFiles/Login.htm', 'Search', 'width=600,height=450,left=150,top=200,scrollbars=1,toolbar=no,menubar=yes,status=1');
        return false;
    };

};

There are several other variations to the above that I have tried with no luck. 以上是我尝试过的其他几种尝试,但并不顺利。

What am I doing wrong or is this not possible? 我在做什么错或者这是不可能的?

Thank you for your help. 谢谢您的帮助。

You can remove the server-side imagemap. 您可以删除服务器端图像映射。

All that is wrong with the client-side imagemap is that you have got the width and height for the image switched. 客户端图像映射的所有错误之处在于您已经获得了切换图像的宽度和高度。 It should be width="32" height="70" . 它应该是width="32" height="70"

Also, the video area has it's co-ordinates mixed up: it should read <area coords="0,0,32,34"... . 另外,视频区域的坐标混合在一起:它应显示为<area coords="0,0,32,34"...

Hope that helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM