jQuery弹出和滚动帮助 [英] JQuery pop and scroll help

查看:96
本文介绍了jQuery弹出和滚动帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要帮助立即

Need help immediately,

$(document).ready(function() {

        $('.ImageClass').mouseenter(function(event) {
        debugger;
         if(MyTemplateOutput.style.visibility !="visible"){

           imageOrdinates(event);
            var Id = $(this).attr('href').split("#");
            var RgnID = Id[1];
            var params = {
                RegionID: RgnID
            };
            var data = JSON.stringify(params);
           $.ajax(
                {
                    type: "POST",
                    url: "CustomerService.svc/GetCustomers",
                    dataType: "json",
                    data: data,
                    contentType: "application/json; charset=utf-8",
                    success: function(json) {

                        var output = $('#MyTemplate').parseTemplate(json);
                        $('#MyTemplateOutput').html(output);
                        $('MyTemplateOutput');

                       MyTemplateOutput.style.visibility ="visible";

                    }

                });

          }
        });


         $('.ImageClass').mouseleave(function() {
        MyTemplateOutput.style.visibility = "hidden";
         });

        function imageOrdinates(event) {
            $('#MyTemplateOutput').css({

                top: (event.pageY - 275) + "px",
                left: (event.pageX - 475) + "px"
            });

        };


    });





上面是我的jquery,其中我使用的模板将在运行时动态生成.

问题1:在mouseover/mouseenter(都尝试过)上,我得到一个弹出窗口,其中包含值列表.我无法选择列表中的值.我无法进入弹出窗口.

问题2:由于弹出窗口包含值列表,因此我需要在外部应用滚动(而不是溢出")并为滚动应用样式的帮助

我必须将滚动条用于模板内部的"div"内部的"ul"标签


模板:





Above is my jquery where I am using a template which will be generated dynamically at run time.

Problem1: On mouseover/mouseenter(tried both) i get a popup which has list of values in it. I am unable select the values inside the list. I am not able to enter the popup.

Problem2: As my pop up has a list of values i need help in applying a scroll(not the "overflow") externally and apply style for my scroll

i have to apply scroll for "ul" tag which is inside "div" which is inside template


Template :

<script id="MyTemplate" type="text/html">
     <div  class="roomdetailsBox">
       <ul>
           <#

           var customer;

               for(var i=0; i < d.length; i++)

               {

                   customer = d[i];

           #>

          <li><a href="#"><strong><#= customer.TourTitle #></strong>  <#= customer.TripLength #> Days From $<#= customer.Price1 #></a></li>
           <#

               }

           #>
         </ul>
     </div>

   </script>





非常感谢





Thanks a lot

推荐答案

(document).ready(function(){
(document).ready(function() {


(.ImageClass').mouseenter(function(如果(MyTemplateOutput.style.visibility!= " ){ imageOrdinates(事件); var ID =
('.ImageClass').mouseenter(function(event) { debugger; if(MyTemplateOutput.style.visibility !="visible"){ imageOrdinates(event); var Id =


( this ).attr(' href').split(" #"); var RgnID = ID [ 1 ]; var 参数 = { RegionID:RgnID }; var data = JSON.stringify( params );
(this).attr('href').split("#"); var RgnID = Id[1]; var params = { RegionID: RgnID }; var data = JSON.stringify(params);


这篇关于jQuery弹出和滚动帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆