Skip to content

Commit

Permalink
docs upd
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov committed Oct 26, 2013
1 parent 90fdfb3 commit 7b85f6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion magnific-popup.jquery.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "magnific-popup",
"title": "Magnific Popup",
"description": "Fast, light, mobile-friendly and responsive lightbox and modal dialog plugin. Open inline HTML, ajax loaded content, image, form, iframe (YouTube video, Vimeo, Google Maps), photo gallery. In/out animation effects are added with CSS3 transitions.",
"description": "Fast, light, mobile-friendly and responsive lightbox and modal dialog plugin. Open inline HTML, ajax loaded content, image, form, iframe (YouTube video, Vimeo, Google Maps), photo gallery. Animation effects added with CSS3 transitions. For jQuery or Zepto.",
"version": "0.9.8",
"homepage": "http://dimsemenov.com/plugins/magnific-popup/",
"demo": "http://dimsemenov.com/plugins/magnific-popup/",
Expand Down
4 changes: 3 additions & 1 deletion website/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1155,14 +1155,16 @@ See [example on CodePen](http://codepen.io/dimsemenov/pen/JGjHK).

### How to override some function without modifying the source files?

Rewrite the function that you wish to modify in Magnific Popup class prototype object, for example to override function that sets focus on some element (add this code after popup JS file is included, but before popup is initialized):
Rewrite the function that you wish to modify by editing Magnific Popup class prototype, you can access it like so `$.magnificPopup.proto`. For example to override function that sets focus on some element:

{% highlight javascript %}
// add this code after popup JS file is included, but before popup is initialized
$.magnificPopup.proto._setFocus = function() {
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
};
{% endhighlight %}

You may override any public function, just note that this change applies globally.

<h2 id="contribute">Make Magnific Popup better!</h2>

Expand Down

0 comments on commit 7b85f6c

Please sign in to comment.