Click here to Skip to main content
16,004,806 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Need help immediately,

C#
$(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"
            });

        };


    });




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 :
XML
<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
Posted
Updated 19-Apr-12 2:07am
v2

Hi

I tried some code for your requirement check it once


HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Article Post Page</title>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Scripts/jscolor.js" type="text/javascript"></script>
    <script language="javascript">
        $(document).ready(function () {
            $('#testing1div').html($('#MyTemplate').html());
        }); 
     </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="MainScreen" align="center">
        <div id="testing1div">
        </div>
        <script id="MyTemplate" type="text/html">
     <div class="roomdetailsBox">
       <ul style=" height:200px; overflow-y :scroll;">
          <li><a href="javascript:alert('testing1');">sdfsd</a></li>
          <li><a href="javascript:alert('testing2');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing3');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing1');">sdfsd</a></li>
          <li><a href="javascript:alert('testing2');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing3');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing1');">sdfsd</a></li>
          <li><a href="javascript:alert('testing2');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing3');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing1');">sdfsd</a></li>
          <li><a href="javascript:alert('testing2');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing3');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing1');">sdfsd</a></li>
          <li><a href="javascript:alert('testing2');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing3');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing1');">sdfsd</a></li>
          <li><a href="javascript:alert('testing2');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing3');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing1');">sdfsd</a></li>
          <li><a href="javascript:alert('testing2');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing3');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing1');">sdfsd</a></li>
          <li><a href="javascript:alert('testing2');">sdfsdf</a></li>
          <li><a href="javascript:alert('testing3');">sdfsdf</a></li>

         </ul>
     </div>
 
        </script>
    </div>
    </form>
</body>
</html>


I hope you understood what I did

All the Best
 
Share this answer
 
From your code i can see that u have applied style for "ul" tag.. But that doesn help me in any way :( I am still unable to get into the popup. And i cant apply apply style to the scroll which u have used.

Thanks for trying :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900