Skip to content

Plugin Jquerry to crop physically picture in a container like a "background : cover" css style

License

Notifications You must be signed in to change notification settings

uowis/jQuery-Smartcrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jQuery-Smartcrop

Plugin Jquery to crop physically picture in a container like a "background : cover" css style

##Include js and css Include js before plugin using and after jQuerry includes:

  <script type="text/javascript" src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  <script type="text/javascript" src="smartcrop.js"></script>
  <script type="text/javascript">
    $(function () {
        $("<container_selector>").smartCrop();
    });
  </script>

##Using SmartCrop Use the smartcrop plugin on domready listener on the img parent container :

Exemple :

  $(function () {
      $("[data-smartcrop-container]").smartCrop();
  });

For this element:

   <div data-smartcrop-container>
        <img src=""/>
    </div>

##Don't override css Some css style are essential, respect css which you should found on smartcrop.css

##Test him An example

About

Plugin Jquerry to crop physically picture in a container like a "background : cover" css style

Resources

License

Stars

Watchers

Forks

Packages

No packages published