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);
- });
- });
- jQuery('div').each(function() {
- $(this).data('onClick', this.onclick);
- $(this).attr('onClick', '');
- $(this).click(function(event) {
- window.setTimeout( function(obj) {
- return function() {$(obj).data('onClick').call(obj, event || window.event)};
- }(this), 5000)
- });
- });
- });
- </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