Hi all,
I am developing a website and want to implement svg files to help in regards to retina displays, but want a fall back png file as a back up.
This is the html/js;
- <div id="band">
- </div> <!--band-->
- <script>
- $(document).ready(function() {
- if (Modernizr.inlinesvg) {
- //SVG.
- $('#band').html('<img src="barbGradient.svg" />');
- } else {
- //No SVG.
- $('#band').html('<img src="barbGradient.png" />');
- }
- });
- </script>
this is the css:
- }
- .no-inlinesvg div#band {
- position: relative;
- top: -950px;
- background-repeat: repeat-x;
- background-image: url('../_images/barbGradient.png');
- z-index: -1;
- }
- .inlinesvg div#band {
- position: relative;
- top: -950px;
- background-repeat: repeat-x;
- background-image: url('../_images/barbGradient.svg');
- z-index: -1;
- }
All the browsers are rendering horribly! I know I can include two pngs at different resolution, but I find the js method to be smarter! Any help would be appreciated!