- This topic is empty.
-
AuthorPosts
-
October 11, 2012 at 2:40 pm #40253chrisburtonParticipant
Does anyone know how @chriscoyier uses SVG images on his latest article with PNG fallback for older browsers/devices that do not support it?
I would also like to see an article about this or something in the snippet section.
October 11, 2012 at 3:41 pm #111696Chris CoyierKeymasterI just don’t put a fallback in, in that case, just cause the site itself only support IE 9+
But… you could always do like
if (!Modernizr.svg) {
$(“img”).each(function() {
$(this).attr(“src”, $(this).data(“fallback”));
});
}or something…
October 11, 2012 at 3:45 pm #111697chrisburtonParticipant@chriscoyier I’m also only supporting IE9+. However, you mentioned in one of your articles that some devices (I think it was an android tablet) do not support SVG. Would this work also (I can’t test for Android)?
November 28, 2012 at 3:38 am #115719pauginerMemberI’m recently using the “Invisible Gradient” technique to support SVG with PNG fallback. It is CSS-only, does not require javascript and it works cross-browser.
It defines a background composed of the SVG image and a transparent gradient. The last makes only gradient-capable browsers (which also understand SVG) to process the SVG part.
More details (and code example) at http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique
March 20, 2013 at 4:07 pm #129041karl1146MemberPauginer’s invisible gradient technique seems to work well to me (thanks!), and it’s fairly simple compared with other solutions. I’m still sort almost kinda supporting ie8, so having some fallback seems like a good plan.
With the new higher resolution (2560×1440) monitors, and high resolution mobile devices, transitioning to SVG images seems like a wise course of action for clip art, some icons, etc. There’s an inherent challenge with phones like the Galaxy S IV in delivering content to a 1920px screen that could be on a 3G connection, and SVG seems like a good solution.
April 9, 2013 at 12:24 pm #131140Pablo_DMemberYou can also use SVGeezy (javascript)
A simple JavaScript plugin which detects SVG images on your website, and automatically “looks” for a standard image fallback for those older, less capable browsers.
April 10, 2013 at 12:58 am #131207chrisburtonParticipantMay 24, 2013 at 2:04 pm #136370jeremymansfieldMember@pauginer Thanks for the tip on the “Invisible Gradient” technique. I’ve spent way too many hours trying to get other solutions to work ideally and without bloated code, but this was the best trick so far in order to support IE8 and IE7. Thanks!
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.