locked
Navigation without blinking

    Question

  • I am trying to change the src url with some jquery on page1.  So far so good. But if I am on another page (i.e. page2), I have to navigate to page1 first. This is causing the blinking issue.  Could the onbeforenavigate in WinJS work? Basically I want to navigate and change the url simultaneously, no blinking.  Thanks for any help.

    $(btn1).click(function () {
      var src = "http://somesite.net/folder/WEB_" + origin + "_" + area + "_" + level + "_" + type + "_" + time + "HR.png";
             WinJS.Navigation.navigate('/pages/home/home.html');
             change_area('GB');
             change_type('typeB')
             $('#mainmap').attr('src', src);
    });

    Sunday, August 17, 2014 4:30 PM

Answers

  • Hi hxnwx,

    Not quite understand your question, but I would say navigate function has an initialState parameter, by which you can pass the src together with the method and apply the url to src when page loaded. Could this avoid the blinking?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, August 18, 2014 7:48 AM
    Moderator
  • Yes, you can, JQuery 2.20+ version are supported in Windows Store App.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, August 26, 2014 6:29 AM
    Moderator

All replies

  • Hi hxnwx,

    Not quite understand your question, but I would say navigate function has an initialState parameter, by which you can pass the src together with the method and apply the url to src when page loaded. Could this avoid the blinking?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, August 18, 2014 7:48 AM
    Moderator
  • This might work but how am I passing the url?  Can I use jquery for the initialState parameter?  Something like this? 

    $(btn1).click(function () { change_area('USNE'); change_type('RCTP'); var src = "http://somesite.net/folder/WEB_" + origin + "_" + area + "_" + level + "_" + type + "_" + time + "HR.png"; WinJS.Navigation.navigate('/pages/home/home.html', {

    $('#mainmap').attr('src', src);}).done; });


    Friday, August 22, 2014 4:07 PM
  • Yes, you can, JQuery 2.20+ version are supported in Windows Store App.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, August 26, 2014 6:29 AM
    Moderator