Results 1 to 4 of 4

Thread: zooming/scaling not working in Chrome

  1. #1
    Join Date
    Jun 2008
    Posts
    192
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default zooming/scaling not working in Chrome

    Hello,

    I'm experimenting with zooming/scaling.

    I've got this CSS class attached to a div:

    Code:
    .zoom
    {
        -ms-zoom: 0.75;
        -moz-transform: scale(0.75);
        -moz-transform-origin: 0 0;
        -o-transform: scale(0.75);
        -o-transform-origin: 0 0;
        -webkit-transform: scale(0.75);
        -webkit-transform-origin: 0 0;
    }
    This seems to work in IE, but not in Chrome. Is there something I need to added for Chrome browsers?

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    shouldn't there be some non-vendor-prefixed properties in there too?
    Code:
        transform: scale(0.75);
        transform-origin: 0 0;
    If you need more help, please provide a link to your page.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Jun 2008
    Posts
    192
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default

    Thanks Beverly,

    It turns out it had to do with the way I was adding these style. I was adding them dynamically through javascript like so:

    $("#MyDiv").css("-ms-zoom", "0.75");

    ...and apparently that doesn't work with these vendor transforms. However, if I add the class like so:

    $("#MyDiv").addClass("zoom");

    it works.

    Oddly enough, I can't add normal css this way. So if I had:

    .zoom
    {
    padding: 12.5%;
    -ms-zoom: 0.75;
    ...
    }

    The padding won't show up when I add the class through javascript. But if I add the padding after I add the class like so:

    $("#MyDiv").addClass("zoom");
    $("#MyDiv").css("padding", "12.5%");

    It works fine.

    Are these vendor specific styles typically kept in a separate class from normal styles?

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Vendor prefixed properties are normally just added to the same class/id as the unprefixed one. Modern browsers are dropping the need for prefixes so, if you're not sure which you should use, you can use an online tool such as this http://pleeease.io/play/ just type in the unprefixed CSS and it will auto-generate all the prefixes you need for your CSS to work.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

Similar Threads

  1. Replies: 6
    Last Post: 05-18-2011, 08:52 PM
  2. Help required about Image Scaling
    By EliteCoder in forum Looking for such a script or service
    Replies: 0
    Last Post: 08-28-2007, 10:17 PM
  3. How to do zooming
    By fung in forum Looking for such a script or service
    Replies: 3
    Last Post: 03-15-2007, 08:39 PM
  4. image zooming
    By ngo van hinh in forum JavaScript
    Replies: 1
    Last Post: 10-10-2005, 05:54 AM
  5. Scaling HVMENU to Display Resolution
    By Lauren in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 10-03-2005, 05:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •