弹出图片层

图层

html

<%@ Page Language="C#" AutoEventWireup="true" Codebehind="DrugView.aspx.cs" Inherits="BusinessApp.Orders.DrugView"  %>

<!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>
        <%=Application["title"] %>
    </title>
     <script type="text/javascript">
     //重新覆盖 thickbox.js里的tb_show方法
     function ShowPopup(url)
    {  
        window.top.tb_show(null,url,false);
    } 
    
    </script>
    <style type="text/css">
        ul li
        {
            float: left;
        }
    </style>
    <script language="javascript" type="text/javascript">
           $(function() {
             $('a.tooltip').hover(function(e) {
                this.myTitle = this.title;
                var imgTitle = this.myTitle ? "<br>" + this.myTitle : "";
                var tooltip = "<div id='tooltip' style='position:absolute;top:162px;left:445px;display:none;'> <img width='300px' heigth='300px' src='" + this.href + "' alt='产品预览图' /></div>";
                $("#tdContent").append(tooltip);
                $('#tooltip').fadeIn("1500");
            },
            function() {
                $('#tooltip').fadeOut("1000");
                $("#tooltip").remove();
            });
        });
//         $("img[alt=ProductPicture]").hover(
//              function(e){ 
//                   $("#tableContent").append("<div id='test' style='position:absolute;120px; height:160px;display:none;'></div>");
//                   $("<img src='' id='testImg' height='150px' width='150px' />").attr("src",$(this).attr("src")).appendTo("#test");
//                   $("#test").css("top", (e.pageY - 120) + "px").css("left", (e.pageX - 300) + "px").fadeIn("slow");
//                   
//              },
//              function(e){
//                  $("#test").fadeOut("fast");
//                  $("#test").remove();  
//              }
//         );
      function checkNum()
      {
        
        if(document.getElementById("HiddenIsCk").value == "0")
        {
             if( parseInt(document.getElementById("txtBuyNum").value) ==0 && parseInt(document.getElementById("txtBuyPiece").value) == 0)
             {
                alert("请输入购买数量");
                
                document.getElementById("txtBuyNum").select();
                $get("txtBuyNum").focus();
                return false;
             }
             if( !IsInt( $get("txtBuyNum").value ) || !IsInt($get("txtBuyPiece").value ))
             {
               alert("购买数量输入不正确");
               if($get("txtBuyNum").value != "0")
               {
                    $get("txtBuyNum").select();
                    $get("txtBuyNum").focus();
               }
               else
               {
                    $get("txtBuyPiece").select();
                    $get("txtBuyPiece").focus();
                }
                    
               return false;
             
             }
             else
             {
               if($get("txtBuyNum").value % $get("<%=hidZbz.ClientID %>").value != 0) 
               {
                  alert("购买数量必须是中包装的整倍数!");
                  $get("txtBuyNum").select();
                  $get("txtBuyNum").focus();
                  return false;
               }
                var buynum = $get("txtBuyNum").value;
                var buyPiece = $get("txtBuyPiece").value
                buynum = buynum.replace(/\s/gi,"");
                buyPiece = buyPiece.replace(/\s/gi,"");
                
                var kcsl = document.getElementById("HiddenFieldKCsl").value;
                if(buynum > 0 )
                {
                    if(kcsl != "" && kcsl != "0")
                    {
                        
                        //var buyAllNum = parseInt($get("HiddenBz").value)*parseInt(buyPiece)+parseInt(buynum);//包装乘以件数+输入的零货数
                        var buyAllNum = parseInt(buynum)%parseInt($get("HiddenBz").value);//只判断输入的件数是否有库存
                        
                        if( parseInt(buyAllNum) > parseInt(kcsl))
                        {
                            alert("库存量不足,当前零货为"+kcsl+",请重新输入购买数量!");//库存
                            $get("txtBuyNum").select();
                            $get("txtBuyNum").focus();
                            return false;
                        }
                    }
                    else
                    {
                        alert("当前药品暂无库存!");
                        $get("txtBuyNum").select();
                        $get("txtBuyNum").focus();
                        return false;
                    }
                }
             
             }
         }
         else
         {
            if(parseInt(document.getElementById("txtBuyPiece").value) == 0)
             {
                alert("请输入购买件数");
                
                document.getElementById("txtBuyPiece").select();
                $get("txtBuyPiece").focus();
                return false;
             }
             if( !IsInt($get("txtBuyPiece").value ))
             {
                alert("购买件数输入不正确");
                $get("txtBuyPiece").select();
                $get("txtBuyPiece").focus();
               return false;
             }
             else
             {
                
                var buyPiece = $get("txtBuyPiece").value
               
                buyPiece = buyPiece.replace(/\s/gi,"");
                
                var kcsl = document.getElementById("HiddenFieldKCsl").value;//库存值
                if(buyPiece > 0 )
                {
                    if(kcsl != "" && kcsl != "0")
                    {
                        var buyAllNum = parseInt($get("HiddenBz").value)*parseInt(buyPiece);//包装乘以件数
                        
                        if( parseInt(buyAllNum) > parseInt(kcsl))
                        {
                            alert("库存量不足,当前库存为"+kcsl+",请重新输入购买件数!");//零货
                            $get("txtBuyPiece").select();
                            $get("txtBuyPiece").focus();
                            return false;
                        }
                    }
                    else
                    {
                        alert("当前药品暂无库存!");
                        $get("txtBuyPiece").select();
                        $get("txtBuyPiece").focus();
                        return false;
                    }
                }
             
             }
             
         }
         
         
         return true;
      } 
      
      //判断 v 是否是整数
      function IsInt(v)
      {
         var vArr =v.match(/^[0-9]+$/);// v.match(/^[0-9]+$/);
         if (vArr == null)
         {
           return false;
         }
         else
         {
           return true;
         }
      }   
      function resetForm()
      {
         if(document.getElementById("HiddenIsCk").value == "0")
        {
            document.getElementById("txtBuyNum").value = "";
            document.getElementById("txtBuyNum").focus();
        }
        else
        {
            document.getElementById("txtBuyPiece").value = "";
            document.getElementById("txtBuyPiece").focus();
        }
      }
    </script>
  <style type="text/css">
        .tablstyel1 td{padding:5px 3px 5px 3px;}
    </style>
    <link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <!--##################订购窗口##################-->
       <%-- <div class="order-box">--%>
            <asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" >
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
                <ContentTemplate>
                   <h2>
              <%--      <span class="dgtb">--%>
                        <span >订购商品</span><span class="dgtbfs">请填写需要购买的数量</span></h2>
                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#d4e4f7" class="tablstyel1">
                            <tr>
                                <td align="right" bgcolor="#f3f6fc" width="15%">
                                    产品图片:</td>
                                <td bgcolor="#fcfdfe" id="tdContent" colspan="3"  >
                                        <ul style="list-style-type: none; float: left;">
                                            <asp:Repeater ID="rptImgList" runat="server">
                                               <ItemTemplate>
                                               <li><a href="YWPicShow.aspx?picid=<%# Eval("PicId").ToString() %>" class="tooltip" title="">
                                                   <img alt="产品图片" width="100px" height="100px" src="YWPicShow.aspx?picid=<%# Eval("PicId").ToString() %>" />
                                               </a></li>
                                               </ItemTemplate>
                                            </asp:Repeater>
                                        </ul>
                                    </td>
                            </tr>
                            <tr>
                                <td align="right" bgcolor="#f3f6fc">
                                    药品名称:</td>
                                <td bgcolor="#fcfdfe" class="color6">
                                    <font color="red">
                                        <asp:Label ID="Label1ypmc" runat="server"></asp:Label>
                                        <asp:HiddenField ID="HiddenSource" runat="server" />
                                    </font>
                                </td>
                                <td align="right" bgcolor="#f3f6fc">
                                    产地:</td>
                                <td bgcolor="#fcfdfe" class="color6">
                                    <asp:Label ID="LabelCdmc" runat="server"></asp:Label></td>
                            </tr>
                            <tr>
                                <td align="right" bgcolor="#f3f6fc">
                                    规格:</td>
                                <td bgcolor="#fcfdfe" class="color6">
                                    <asp:Label ID="LabelGG" runat="server"></asp:Label></td>
                                    <td align="right" bgcolor="#f3f6fc">
                                    批号:</td>
                                <td bgcolor="#fcfdfe" class="color6">
                                    <asp:Label ID="LabelPh" runat="server"></asp:Label></td>
                            </tr>
                            <tr>
                                <td align="right" bgcolor="#f3f6fc">
                                    包装:</td>
                                <td bgcolor="#fcfdfe" class="red">
                                    <font color="red">
                                        <asp:Label ID="LabelBz" runat="server"></asp:Label>
                                        <asp:HiddenField ID="HiddenBz" runat="server" />
                                    </font>
                                </td>
                                <td align="right" bgcolor="#f3f6fc">
                                    中包装:</td>
                                <td bgcolor="#fcfdfe" class="red">
                                    <font color="red">
                                        <asp:Literal ID="litZBZ" runat="server" Text="无"></asp:Literal> 
                                        <asp:HiddenField ID="hidZbz" Value="" runat="server" />                               
                                    </font>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" bgcolor="#f3f6fc">
                                    单位:</td>
                                <td bgcolor="#fcfdfe" class="color6">
                                    <asp:Label ID="LabelDw" runat="server"></asp:Label></td>
                                     <td align="right" bgcolor="#f3f6fc">
                                    是否拆零:</td>
                                <td bgcolor="#fcfdfe" class="red">
                                    <font color="green">
                                        <asp:Label ID="LabelIsCk" runat="server"></asp:Label>
                                        <asp:HiddenField ID="HiddenIsCk" runat="server" />
                                    </font>
                                </td>
                            </tr>
                            <tr>
                                    <td align="right" bgcolor="#f3f6fc">
                                        有效期:</td>
                                    <td bgcolor="#fcfdfe">
                                        <asp:Label ID="lblYxq" runat="server"></asp:Label>
                                        <asp:Label ID="lblYxqInfo" runat="server"></asp:Label>
                                    </td>
                                     <td align="right" bgcolor="#f3f6fc">
                                    单价:</td>
                                <td bgcolor="#fcfdfe" class="red">
                                    <font color="red">
                                        <asp:Label ID="Labeldj" runat="server"></asp:Label>
                                        <asp:HiddenField ID="HiddenYprice" runat="server" />
                                    </font>
                                </td>
                                </tr>
                             <tr>
                                <td align="right" bgcolor="#f3f6fc">
                                    库存:</td>
                                <td bgcolor="#fcfdfe" colspan="3" >
                                    <font color="red">
                                        <asp:Label ID="LabKcsl" runat="server"></asp:Label>
                                         <asp:HiddenField id="HiddenFieldKCsl" runat="server" />
                                    </font><asp:Label ID="LabDw2" runat="server"></asp:Label>
                                </td>
                            </tr>
                            
                            <div id="divPromotionInfo" runat="server" visible="false">
                            <tr>
                                <td align="right" bgcolor="#f3f6fc">
                                    促销内容:</td>
                                <td bgcolor="#fcfdfe" colspan="3" >
                                    <font color="green">
                                        <asp:Label ID="LabelSalesContent" runat="server"></asp:Label>
                                    </font>
                                </td>
                            </tr>
                            </div>
                            
                            <tr>
                                <td align="right" bgcolor="#f3f6fc">
                                    购买数量:</td>
                                <td bgcolor="#fcfdfe" colspan="3" >
                                    <asp:TextBox ID="txtBuyPiece" runat="server" CssClass="formbk13" MaxLength="3">0</asp:TextBox>件
                                        <asp:TextBox ID="txtBuyNum" runat="server" CssClass="formbk13" MaxLength="5" Visible="false" >0</asp:TextBox>
                                        <asp:Label ID="LabDw3" runat="server" Visible="false"></asp:Label>                                        
                                    <span class="red">*</span>
                                    <asp:Literal ID="litTip" runat="server"></asp:Literal>
                                </td>
                            </tr>
                    <table width="100%" height="44" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td height="44" align="center">
                                <asp:Button ID="btnAddOrder" runat="server" CssClass="xgbtn" Text="提交" OnClick="btnAddOrder_Click"
                                    OnClientClick="javascript:return checkNum();" />
                            </td>
                            <td align="center">
                                <input name="btnReset" type="button" class="xgbtn" value="重填" onclick="resetForm();" />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        <%--</div>--%>
        <!--##################订购窗口end##################-->
    </form>
</body>
</html>

原文地址:https://www.cnblogs.com/Leo_wl/p/2008225.html