keyboard
10-07-2012, 09:32 AM
Hey Guys!
This is my code so far -
content_swapper.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="content_swapper.js"></script>
<script type="text/javascript">
$(window).load(function(){
$('.swap_me').fldr_content_swap({
});
});
</script>
</head>
<body>
<div class="swap_me">a</div>
<div class="swap_me">b</div>
<div class="swap_me">c</div>
<div class="swap_me">d</div>
</body>
</html>
content_swapper.js
$.fn.fldr_content_swap = function() {
var args = arguments[0] || {};
$(this).hide();
};
After all the elements with the class swap_me are hidden, I'd like it to get the third element with the class swap_me (in the javascript file) ONLY using this() (e.g. I don't wan't to have to send swap_me to the function as a parameter).
How do I do this?
This is my code so far -
content_swapper.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="content_swapper.js"></script>
<script type="text/javascript">
$(window).load(function(){
$('.swap_me').fldr_content_swap({
});
});
</script>
</head>
<body>
<div class="swap_me">a</div>
<div class="swap_me">b</div>
<div class="swap_me">c</div>
<div class="swap_me">d</div>
</body>
</html>
content_swapper.js
$.fn.fldr_content_swap = function() {
var args = arguments[0] || {};
$(this).hide();
};
After all the elements with the class swap_me are hidden, I'd like it to get the third element with the class swap_me (in the javascript file) ONLY using this() (e.g. I don't wan't to have to send swap_me to the function as a parameter).
How do I do this?