Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- // Product Page Tab Highlight
- $(document).ready(function() {
- $("#TabProductInfo li a").each(function() {
- $(this).click(function() {
- // Grab value of id attribute
- var vID = $(this).attr("id");
- // Find the id dynamically and find the current bg image of the hover state
- var hov = $("#" + vID + ":hover").css("background-image");
- // Set an inline style with the hover state's bg
- $(this).attr("style", "background-image: " + hov);
- // After selecting a new tab, iterate through prior tabs and remove their bg images
- $("#TabProductInfo li").find("a").each(function() {
- sValue = $(this).attr("class");
- if (sValue != "selected") {
- $(this).removeAttr("style");
- }
- });
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement