Created
September 6, 2017 08:37
-
-
Save rambhairao/f54140ceef831f2649d975a8579705f3 to your computer and use it in GitHub Desktop.
JS Bin// source http://jsbin.com/fudife
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.rang{ | |
background-color: blue; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="random"> | |
<p> random article-0 </p> | |
<p> random article-1 </p> | |
<p> random article-2 </p> | |
<p> random article-3 </p> | |
</div> | |
<script id="jsbin-javascript"> | |
$(document).ready(function(){ | |
$(".random p").on('click', function(){ | |
var x = $(".random p").index(this); | |
// $(this).addClass("rang").sibling().removeClass("rang"); | |
// $('.random p').eq(0).after().$(".random p").eq(x); | |
$(".random ").find("p").eq(0).after($(".random p ").eq(x)); | |
}); | |
}); | |
</script> | |
<script id="jsbin-source-css" type="text/css">.rang{ | |
background-color: blue; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">$(document).ready(function(){ | |
$(".random p").on('click', function(){ | |
var x = $(".random p").index(this); | |
// $(this).addClass("rang").sibling().removeClass("rang"); | |
// $('.random p').eq(0).after().$(".random p").eq(x); | |
$(".random ").find("p").eq(0).after($(".random p ").eq(x)); | |
}); | |
}); | |
</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
.rang{ | |
background-color: blue; | |
} |
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
$(document).ready(function(){ | |
$(".random p").on('click', function(){ | |
var x = $(".random p").index(this); | |
// $(this).addClass("rang").sibling().removeClass("rang"); | |
// $('.random p').eq(0).after().$(".random p").eq(x); | |
$(".random ").find("p").eq(0).after($(".random p ").eq(x)); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment