GithubHelp home page GithubHelp logo

primaapriansyah / svgeezy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benhowdle89/svgeezy

0.0 2.0 0.0 419 KB

Allows for automatic Image fallbacks for browsers that can't handle SVGs

Home Page: http://benhowdle.im/svgeezy/

License: MIT License

JavaScript 100.00%

svgeezy's Introduction

SVGeezy

A JavaScript plugin to handle your images in browsers that don't support SVGs

SVGeezy is in essence, a fallback plugin. It allows you to use SVGs for all your assets, giving you complete resolution independence.

It checks if the browser supports SVGs, if not, changes the src of the image to a .png instead (or whatever you pass in).

Installing SVGeezy

SVGeezy can being installed using bower with bower install svgeezy. Alternatively, you can download or clone this repo manually.

Use

svgeezy.init('nocheck', 'png'); // this will tell the plugin to not check images with a class of 'nocheck'

or

svgeezy.init(false, 'png');	// this will let the plugin check all images

or

Check out this JSFiddle for example usage

The first parameter is a class to tell the code not to check. Feel free to pass in false if you want SVGeezy to check all images. This may be because you have no fallbacks for certain SVGs.

The second is a filetype, this can be anything you want, just make sure the file path resolves to an image. ie. '/images/logo.svg', will be replaced with '/images/logo.png'.

svgeezy's People

Contributors

benhowdle89 avatar nicholasruunu avatar christianhanvey avatar djgrant avatar bryanstedman avatar jverdeyen avatar lewisnyman avatar lukereative avatar hitautodestruct avatar

Watchers

James Cloos avatar Prima Utama Apriansyah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.