No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Responsive images

    Framework
    3
    8
    2390
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • digiproduct
      digiproduct last edited by

      I looked at the QImg component and the responsive section using srcset … and that’s a great solution for when you are able to create the necessary additional images.

      But, what about the situation where you don’t have access to the images … for example, maybe you’re pulling in the image from some external feed … what’s the best solution for making these images responsive? Is there anything in the CSS classes to help deal with this?

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        I’m noob-like on this subject, but this seems like a method.

        https://www.w3schools.com/howto/howto_css_image_responsive.asp

        Used in a pen…

        https://codepen.io/smolinari/pen/mYJgLy

        Anyone with more experience, please do chime in!!!

        Scott

        1 Reply Last reply Reply Quote 1
        • digiproduct
          digiproduct last edited by

          Thanks, @s-molinari I’ll try adding adding a class like that via a style on a the QLayout and see what happens.

          I wasn’t expecting it to be so simple … as I normally use Bootstrap with their responsive image class by applying .img-fluid and had expected to find something similar in Quasar.

          1 Reply Last reply Reply Quote 0
          • digiproduct
            digiproduct last edited by

            and thanks for the Codepen @s-molinari

            1 Reply Last reply Reply Quote 0
            • s.molinari
              s.molinari last edited by

              No problem.

              Scott

              1 Reply Last reply Reply Quote 0
              • wcomnisky
                wcomnisky last edited by

                The downside of this approach will be the size of the image (in kB) that will be the same even for smaller resolutions/devices (considering an image with big resolution/size); but the other way around may be an issue too where you have a small image that will be stretched for bigger resolutions/devices.

                A solution could be a crawler to download the image(s) and resize them in parallel in a background task (in the case of the big resolution).

                1 Reply Last reply Reply Quote 0
                • digiproduct
                  digiproduct last edited by

                  @wcomnisky Agree with what you are saying … and that’s fine when things are relatively static …

                  But, when things are more dynamic … such as getting images from a feed that is constantly changing … it’s not really practical to create resized images that might only be required on a very short-term temporary basis.

                  wcomnisky 1 Reply Last reply Reply Quote 0
                  • wcomnisky
                    wcomnisky @digiproduct last edited by

                    @digiproduct Yes, indeed. I imagined that it could be the case.

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post