简体   繁体   English

尝试使用C#asp.net Web表单使epaper动态化

[英]Trying to make epaper dynamic using C# asp.net web form

I have static e paper but i want to develop dynamic e-paper like below url 我有静态电子纸,但我想开发动态电子纸,如以下网址

https://epaper.dawn.com/?page=15_04_2019_001 https://epaper.dawn.com/?page=15_04_2019_001

I have no idea to start e paper dynamic below is my whole html code 我不知道如何启动电子纸动态下面是我的整个html代码

   <!doctype html>
   <html>
   <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>q Times</title>

  <link rel="stylesheet" href="css/main.css">
  <link href="https://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
   <style>
  body { background-color: #fafafa; min-height: 100vh;}
 .container { margin: 200px auto; max-width: 600px; }
  </style>

 <script src="jquery.min.js"></script>

 <script src="jquery.maphilight.min.js"></script>

 <script>

    $(document).ready(function () {
    $("#prev-img,").click(function () {
    //alert($('#show-img').attr('src'));
    var x=$('#show-img').attr('src');
    if(x=='images/1.jpg')
    {
     document.getElementById("show-img").useMap="#enewspaper"

    }
    else if(x=='images/2.jpg')
    {
    document.getElementById("show-img").useMap="#enewspaper1"

    }           
   });



      })
     </script>


     <script>

     $(document).ready(function () {
     $("#next-img,").click(function () {
    //alert($('#show-img').attr('src'));
    var x=$('#show-img').attr('src');
    if(x=='images/1.jpg')
    {
    document.getElementById("show-img").useMap="#enewspaper"

    }
    else if(x=='images/2.jpg')
    {
    document.getElementById("show-img").useMap="#enewspaper1"

    }   

    });



    })
      </script>
     <script type="text/javascript">
    $(function () {
        $(".map").maphilight()
        $(".icon-right,.icon-left,#small-img-roll img").click(
            function () {
                $("div.map img").css("opacity", 1);
                $(".map").maphilight()
                <!--var x = document.getElementById("1").useMap = "#enewspaper";  -->

                 var value = $(this).attr("usemap")

                   if(value==1)
                   {

                 document.getElementById("show-img").useMap="#enewspaper"

                var x = document.getElementById("show-img").useMap;

                  $(".map").maphilight()
                   }
                   else if(value==2)
                   {

                  document.getElementById("show-img").useMap="#enewspaper1"
                    var x = document.getElementById("show-img").useMap;

                  $(".map").maphilight()
                   }
                   }


                    )

                   })


                </script>

                 </head>
                 <body>

                  <div class="container" style="margin-top:0px">


                 <!--<div class="show" href="images/1.png" usemap="#enewspaper">-->
                 <img src="images/1.jpg" id="show-img"  class="map" usemap="#enewspaper" >
                <map name="enewspaper">

               <area shape="rect" alt="" title="" coords="34,136,562,221" href="" target="" />
               <area shape="rect" alt="" title="" coords="372,229,574,468" href="www.google.com" target="" />
              <area shape="rect" alt="" title="" coords="104,227,368,469" href="www.fb.com" target="_New" />
              <area shape="rect" alt="" title="" coords="105,472,230,677" href="www.kk.com" target="" />
               </map>

               <map name="enewspaper1">
               <area shape="rect" alt="" title="" coords="34,136,562,221" href="" target="" />

               </map>

              <div class="small-img">
              <img src="images/online_icon_right@2x.png" class="icon-left" alt="" id="prev-img">
             <div class="small-container">
             <div id="small-img-roll">


            <img src="images/1.jpg" class="show-small-img" alt="1" usemap="1">
            <img src="images/2.jpg" class="show-small-img" alt="2" usemap="2">

           </div>
           </div>
           <img src="images/online_icon_right@2x.png" class="icon-right" alt="" id="next-img">
          </div>

         </div>



            </div>
             <script src="scripts/zoom-image.js"></script>
           <script src="scripts/main.js"></script>


           </body>

i am not getting any idea to implement dynamic, i have to take repeater control or grid view control to achieve dynamic e paper. 我没有实现动态的任何想法,我必须采用中继器控制或网格视图控制来实现动态电子纸。 How to handle MAP and image redirection. 如何处理MAP和图像重定向。

If you take a closer look at your desired result, you will see they have a single image, overlapped with divs. 如果您仔细查看所需的结果,您会看到它们只有一张图像,并与div重叠。 Those were manually defined, meaning for each image someone defined the are of the "target" and on click, a new window will open with only that area. 这些是手动定义的,这意味着对于每个定义了“目标”区域的图像,单击后,将仅打开该区域的新窗口。 Implementing this is relatively simple. 实施起来相对简单。 An image inside a container, also inside the same container a bunch of divs with position:relative . 容器内的图像,也位于同一容器内的一堆div,其position:relative Now, if what you want is all the process be done automatically I would suggest you to start looking into pattern recognition/machine learning. 现在,如果您想要的是自动完成所有过程,建议您开始研究模式识别/机器学习。

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

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