Created
February 15, 2011 15:04
-
-
Save lukemorton/827617 to your computer and use it in GitHub Desktop.
jQuery.sub examples
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>Testing jQuery.sub()</title> | |
</head> | |
<body> | |
<div class="example">Testing</div> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> | |
<script src="with-jquery.sub.js"></script> | |
<script> | |
jQuery(function ($) { | |
$('.example') | |
.fadeOut() | |
.delay(1000) // Does not append paragraph | |
.fadeIn() | |
.myPlugin() | |
.fadeOut() | |
.delay(1001) // Does append paragraph | |
.fadeIn(); | |
$('.example') | |
.fadeOut() | |
.delay(1002) // Does not append paragraph still | |
.fadeIn(); | |
}); | |
</script> | |
</body> | |
</html> | |
This file contains 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
(function ($, myPlugin) { | |
myPlugin.fn.delay = function (delay, queueName) { | |
$('body').append('<p>Delaying for ' + delay + '</p>'); | |
return $.fn.delay.call(this, delay, queueName); | |
}; | |
$.fn.myPlugin = function () { | |
return myPlugin(this); | |
}; | |
}(jQuery, jQuery.sub())); |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>Testing jQuery.sub()</title> | |
</head> | |
<body> | |
<div class="example">Testing</div> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> | |
<script src="without-jquery.sub.js"></script> | |
<script> | |
jQuery(function ($) { | |
$('.example') | |
.fadeOut() | |
.delay(1000) // Does not append paragraph | |
.fadeIn() | |
.myPlugin() | |
.fadeOut() | |
.delay(1001) // Does append paragraph | |
.fadeIn(); | |
$('.example') | |
.fadeOut() | |
.delay(1002) // Does not append paragraph still | |
.fadeIn(); | |
}); | |
</script> | |
</body> | |
</html> | |
This file contains 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
(function ($) { | |
$.fn.myPlugin = function () { | |
this.delay = function (delay, queueName) { | |
$('body').append('<p>Delaying for ' + delay + '</p>'); | |
return $.fn.delay.call(this, delay, queueName); | |
}; | |
return this; | |
}; | |
}(jQuery)); |
hello,
i'm trying to mix a video whit subtitles in a wamp server i dont knwo what im doing wrong....cause it simples play the video but srt file misse...
Do u have any kind of example, tutorial or something to help me out?
Chears from portugal
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Isn't using jQuery.sub() just over complicating matters? I'm not sure I see the benefits in this particular instance.