Created
May 22, 2015 08:17
-
-
Save dstyle0210/1b7e4e13a49788789480 to your computer and use it in GitHub Desktop.
[jquery] 선택된 이미지 배열에서 특정 eq만 on으로 바꿔줌.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // onoff extend | |
| (function($) { | |
| $.fn.onoff = function(n, on, off) { | |
| var n = n; | |
| var on = (!on) ? "On." : on + "."; | |
| var off = (!off) ? "Off." : off + "."; | |
| $(this).each(function(i) { | |
| this.src = (this.src).replace(on, off); | |
| if (i == n) { | |
| this.src = (this.src).replace(off, on); | |
| }; | |
| }); | |
| }; | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment