Created
March 8, 2009 08:38
-
-
Save taelor/75590 to your computer and use it in GitHub Desktop.
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() { | |
$("a").click(function() { | |
if($('#admin_panel').val() != undefined) | |
{ | |
admin_panel_left = $('#admin_panel').css('left') | |
admin_panel_top = $('#admin_panel').css('top') | |
href = $(this).attr('href'); | |
admin_location = "admin_panel_left="+admin_panel_left+"&admin_panel_top="+admin_panel_top | |
//it has a ? and a # | |
if(href.indexOf("#") != -1 && href.indexOf("?") != -1 ) | |
{ | |
url_div = href.split("#") | |
href = url_div[0] + "&" + admin_location + "#" + url_div[1] | |
}// it has a # only | |
else if(href.indexOf("#") != -1) | |
{ | |
url_div = href.split("#") | |
href = url_div[0] + "?" + admin_location + "#" + url_div[1] | |
}//it has a ? only | |
else if(href.indexOf("?") != -1) | |
{ | |
href = href + "&" + admin_location | |
}// it has nothing | |
else | |
{ | |
href = href + "?" + admin_location | |
} | |
$(this).attr('href', href) | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment