Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head><title>test</title>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
- </head>
- <body>
- <script>
- $(document).ready(function() {
- $("a").each(function() {
- var href = $(this).attr("href");
- var target = $(this).attr("target");
- var text = $(this).text();
- $(this).click(function(event) { // when someone clicks these links
- event.preventDefault(); // don't open the link yet
- setTimeout(function() { // now wait 300 milliseconds...
- window.open(href,(!target?"_self":target)); // ...and open the link as usual
- },5000);
- });
- });
- $("div").each(function() {
- var href = $("div").attr("onclick");
- $("div").removeAttr('onclick');
- var real_url = href.split("'");//('http://')
- var new_url = (real_url[1]);
- $("div").click(function(event) { // when someone clicks these links
- setTimeout(function (){
- window.open(new_url,"_self");
- }, 5000);
- // ...and open the link as usual
- });
- });
- });
- </script>
- <a href ="http://google.com"> Google </a>
- <div onclick="location.href='http://yahoo.com'" >test</div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement