locked
How to set web part image according to any screen resolution RRS feed

  • Question

  • Sharepoint 2010

    I am displaying image in the content editor webpart on the right hand side of landing page.

    I have designed this page on 1440 x 900 pixel resolution screen but now when i view it on my laptop (1280 x 800) image doesn't fit on screen i have to scroll to right to view the whole image.

    Is there a way it can be adjusted automatically according to screen resolution.

    Wednesday, January 16, 2013 5:27 PM

Answers

  • Both the image and Documents web part are the problem there. You could change the web part's view to use less space.

    As far a auto-resizing, you would need to add some JavaScript to the page to check the displayed page width and then sent the height and width of the image to fit.


    Mike Smith TechTrainingNotes.blogspot.com my SP customization book

    • Marked as answer by MUAR Wednesday, January 16, 2013 6:00 PM
    Wednesday, January 16, 2013 5:49 PM

All replies

  • Both the image and Documents web part are the problem there. You could change the web part's view to use less space.

    As far a auto-resizing, you would need to add some JavaScript to the page to check the displayed page width and then sent the height and width of the image to fit.


    Mike Smith TechTrainingNotes.blogspot.com my SP customization book

    • Marked as answer by MUAR Wednesday, January 16, 2013 6:00 PM
    Wednesday, January 16, 2013 5:49 PM
  • As Mike already pointed out that you will need to re-size the image on the fly based on the resolution.

    Just to add another option that  you can also create two sets of images i.e. large and small and then you can change them on the fly based on the resolution.

    Check the following example and see if it helps.

    http://buildinternet.com/2009/07/quick-tip-resizing-images-based-on-browser-window-size/


    Amit

    Wednesday, January 16, 2013 5:58 PM