none
Ajax7 page load position and auto scroll to top on mouseover behavior RRS feed

  • Question

  • Please observe the following behavior from this code. If your screen is taller than mine, you might have to increase the heights of the p tags. The page load behavior is different in each browser (IE8, FF3.5, Chrome, Safari). All of them have in common that the first time the user scrolls over the map it jumps to the top.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
      <head>
       <title></title>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       <script src="Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
      </head>
      <body>
       
      <script type="text/javascript">     
        $(document).ready(function () { GetMap(); });
      </script>
    
      <p style="border:solid 1px blue;height:500px">Border</p>
      <p style="border:solid 1px green;height:500px">Border</p>
      <p style="border:solid 1px red;height:500px">Border</p> 
    
      
      <div id="map" style="position:relative;width:720px; height:420px"></div> 
    
      <p style="border:solid 1px orange;height:500px">Border</p> 
    
      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
    
      <script type="text/javascript">
           function GetMap() {
    
           var mOpt = new Object();
           mOpt.credentials = "";
           mOpt.center = new Microsoft.Maps.Location(45.5, -122.5);
           mOpt.zoom = 7;
    
           var map = new Microsoft.Maps.Map(document.getElementById("map"), mOpt);
         }
    
       </script>  
       
      </body>
    </html>
    



    Jonathon - Short contract for hire - www.kresner.com
    • Edited by Jonathon Kresner Monday, March 7, 2011 4:25 PM left key in by mistake
    • Moved by Ricky_Brundritt Friday, March 9, 2012 5:23 PM (From:Bing Maps: Map Control and Web services Development)
    Monday, March 7, 2011 3:57 PM

Answers

  • My website is going live in 2 weeks.

    MS Map gods, please help - been waiting 3 months for this.


    Jonathon

    This should be fixed with latest update. Could you please try? Pls mark as 'answered' if the issue is fixed.
    HemantGoyal
    Saturday, May 7, 2011 6:32 AM

All replies

  • I can confirm that the first time you put your mouse over the map and try to use the mousewheel to zoom the page jumps to the top, will try and look some more
    Brian @ Earthware - UK interactive mapping web developers http://www.earthware.co.uk/blog | http://www.twitter.com/earthware | Windows Live Developer MVP
    Sunday, March 13, 2011 8:37 AM
    Moderator
  • I'm pretty sure that this is a known issue, and possibly one that was introduced in the latest update while correcting other issues that occurred when the map was placed outside the bounds of the the visible page view (i.e. the menu dropdowns appearing out of line).

    @HemantGoyal has already commented in another thread that this will be resolved in an upcoming release: http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/9f505bda-51b2-4545-b6e2-8f5fceedd573


    twitter: @alastaira blog: http://alastaira.wordpress.com/
    Sunday, March 13, 2011 10:37 AM
    Moderator
  • Thank you, I am concerned NOT JUST with the scrolling to top.

    I am concerned with the fact that the page on different browsers is loading in different positions.

    The map is TAKING OVER THE WINDOW and loading the page in weird positions (and NOT at the top). This is a real concern because my users don't understand what's happened and why on firefox they're half way down the page (on top of the map), on chrome they're half way down the page (with the map in view) etc.


    Jonathon
    Sunday, March 13, 2011 9:13 PM
  • Echo .. Echo ... echo ....
    Jonathon
    Saturday, March 26, 2011 8:31 PM
  • My website is going live in 2 weeks.

    MS Map gods, please help - been waiting 3 months for this.


    Jonathon
    Tuesday, April 26, 2011 5:24 PM
  • My website is going live in 2 weeks.

    MS Map gods, please help - been waiting 3 months for this.


    Jonathon

    This should be fixed with latest update. Could you please try? Pls mark as 'answered' if the issue is fixed.
    HemantGoyal
    Saturday, May 7, 2011 6:32 AM
  • My site is no longer password protected.

     

    You can see (or not see) bing maps in it's full glory on any of these pages:

    http://cf4.climbfind.com/rock-climbing/united-states

    http://cf4.climbfind.com/rock-climbing-around/united-states/seattle

    http://cf4.climbfind.com/indoor-climbing/united-states/vertical-world-seattle

    http://cf4.climbfind.com/outdoor-rock-climbing/united-states/rock-wall/cliff-house-crag

    Ohhh and the specific page where this bug was showing the most you can try using FF, IE, Chrome & Safari to confirm youself:

    http://cf4.climbfind.com/rock-climbing-around/united-states/yosemite-valley

     

     


    Jonathon

    Saturday, May 7, 2011 2:46 PM
  • Hi Jonathon -

    Sorry to hear that, I am also not able to access your site. This should be issue different from map. I am getting 504 error, which indicate site is not able to connect to webserver. There is no mapcontrol handler call, which is faling & could be causing it. Below are some of the sites where the map is coming fine.

    http://www.opencaching.com/#find/OX2NM20?&bbox=47.5305,-122.3712,47.8262,-121.8908&  
    http://www.walmart.com/cservice/ca_storefinder.gsp 
    www.zimbio.com/places


    Let us know, if you need any help to resolve your issues.


    HemantGoyal
    Saturday, May 7, 2011 4:31 PM