locked
Window Resize Event not being fired in Task Pane app when the task pane is resized RRS feed

  • Question

  • It seems like the window OnResize event is not fired (or not available) in my Excel Task Pane Add-in when the Task Pane is resized.  Is this event not available because the add-in is in an iframe?  Or am I doing something else wrong.

    Tuesday, February 16, 2016 4:51 PM

Answers

  • Hi Jim,

    >>Is this event not available because the add-in is in an iframe?  Or am I doing something else wrong.

    And as far as I know, there is no feature in the Office online for us to resize the task pane. And this event works well for me if I resize the iframe by change the width directly like figure below:

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 17, 2016 5:21 AM
  • Hi Jim,

    Did you fix the issue now? If not, please let us know the detail about the add-in you were developing. A piece of code to help us to reproduce this issue is appreciate.

    In addition, the windows.onresize works well for me. Please let me know if it doesn't work for you.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, February 18, 2016 12:21 PM

All replies

  • Hi Jim,

    >>Is this event not available because the add-in is in an iframe?  Or am I doing something else wrong.

    And as far as I know, there is no feature in the Office online for us to resize the task pane. And this event works well for me if I resize the iframe by change the width directly like figure below:

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 17, 2016 5:21 AM
  • Fei,

    Thanks for the reply.  I will try what you did in a browser for online Office but in the Office Clients you can definitely resize the Task Pane, such as in Excel for which I am developing a Task Pane app.

    I am using AngularJS in my Task Pane app and the window.resize() event does not get fired.  I have used the same code in other apps to get the window resize event and it works.  Maybe there is a resize() event on the document or at some lower level element in the DOM than "window" that I can get at.  I have access to the window.innerWidth and window.innerHeight when the app loads but I just don't get the event.

    Jim

    Wednesday, February 17, 2016 7:58 PM
  • Hi Jim,

    Did you fix the issue now? If not, please let us know the detail about the add-in you were developing. A piece of code to help us to reproduce this issue is appreciate.

    In addition, the windows.onresize works well for me. Please let me know if it doesn't work for you.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, February 18, 2016 12:21 PM
  • Thanks Fei.  I haven't had a chance to try straight jQuery to see if it's an Angular issue since you seem to be getting the resize event OK.  It is OK to keep this question as answered.

    Thanks again,

    Jim

    Tuesday, February 23, 2016 4:54 AM
  • Hi Jim,

    The code in the previews post is using the build-in JavaScript code. However, based on the test both JQuery and build-in JavaScript works well for the window resize event.

    Here is the test code for your reference.

    JQuery:

      $(window).resize(function () {
                console.log("JQuery:window is resizing...");
            })
    JavaScript:
       window.onresize = function () {
                var message = "JavaScript:window is resizing...";
                console.log(message)
            }

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 24, 2016 1:57 AM