Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5971787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:33:58+00:00 2026-05-22T20:33:58+00:00

I am trying to expand on the code authored by AutoSponge http://www.endusersharepoint.com/2008/12/22/jquery-for-everyone-cleaning-windows-pt2/ Instead of

  • 0

I am trying to expand on the code authored by AutoSponge
http://www.endusersharepoint.com/2008/12/22/jquery-for-everyone-cleaning-windows-pt2/

Instead of using <input type="checkbox" ... /> to trigger the event, I am trying to use

<input type="image" class="toggleClass" id="LeftRight" 
       value="tr:lt(9)" src="../../img/topcollapse.jpg" /> 

and

<input type="image" class="toggleClass" id="UpDown" 
       value="#TitleAreaImageCell, #LeftNavigationAreaCell" 
       src="../../img/leftcollapse.jpg" /> 

to trigger the function. The collapse functions works but the img source does not change. I think that I am not calling it out correctly but I have not been able to figure out why. Thank you in advance for any help on this.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <script type="text/javascript">

         //initialize checkboxes  

         $(function () {

             $("input.toggleClass:image").each(function (i, e) {

                 var v = e.value;
                 var g = GetCookie(v); //SP function
                 var src = ($("#UpDown").attr("src") === "img/up_arrow.bmp")

                 if (g == "1") {    
                     e.checked = true;
                     $(v).hide();
                 }
             });
         });

         //set cookie on click and hide element  

         $(function () {

             $("input.toggleClass:image").click(function (e) {

                 var v = $(e.target).val();
                 var g = GetCookie(v);
                 if (g == "1") {
                     $(v).show();
                     SetCookie(v, "", "/"); //SP function  
                 } else {
                     $(v).hide();
                     SetCookie(v, "1", "/");
                 }
             });
         });

        $(document).ready(function () {
            $("#UpDown").bind("click", function () {
                var src = ($("#UpDown").attr("src") === "../../img/topcollapse.jpg")
                ? "../../img/downcollapse.jpg"
                : "../../img/topcollapse.jpg";
                $("#UpDown").attr("src", src);
            });
        });

        $(document).ready(function () {
            $("#LeftRight").bind("click", function () {
                var src = ($("#LeftRight").attr("src") === "../../img/leftcollapse.jpg")
                ? "../../img/rightcollapse.jpg"
                : "../../img/leftcollapse.jpg";
                $("#LeftRight").attr("src", src);
            });
        });
</script>
</head>

<body>
    <form id="form1" runat="server">
    <div>
    <input type="image" class="toggleClass" id="UpDown" value="#TitleAreaImageCell, #LeftNavigationAreaCell" src="img/leftcollapse.jpg" /><br /><br />
    <input type="image" class="toggleClass" id="LeftRight" value="tr:lt(9)" src="img/topcollapse.jpg" />
    </div>
    </form>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:33:59+00:00Added an answer on May 22, 2026 at 8:33 pm

    Left Nav Pane

    Top Panel

    //initialize images
    $(function() {
    $("input.toggleClass:image").each(function(i,e) {
    var v = e.value;
    var g = GetCookie(v); //SP function

        if (g == "1") {
    
                if (e.src.indexOf("topcollapse.jpg") >= 0)
                  {
                    e.src = "/_layouts/images/downcollapse.jpg";
                  }
               else {
                  if (e.src.indexOf("downcollapse.jpg") >= 0)
                     {
                       e.src = "/_layouts/images/topcollapse.jpg";
                     }
                } 
    
                if (e.src.indexOf("leftcollapse.jpg") >= 0)
                  {
                    e.src = "/_layouts/images/rightcollapse.jpg";
                  }
               else {
                  if (e.src.indexOf("rightcollapse.jpg") >= 0)
                     {
                       e.src = "/_layouts/images/leftcollapse.jpg";
                     }
                } 
    
            //e.checked = true;
            $(v).hide();
        }
    });
    

    });
    //set cookie on click and hide element
    $(function() {
    $("input.toggleClass:image").click(function(e) {
    var v = $(e.target).val();
    var g = GetCookie(v);
    if (g == "1") {
    $(v).show();
    SetCookie(v, "", "/"); //SP function
    }else{
    $(v).hide();
    SetCookie(v, "1", "/");
    }
    });
    });

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using drscheme from: http://www.archlinux.org/packages/extra/x86_64/drscheme/ I'm trying to work with the sample code in
I have a table column I’m trying to expand and hide. jQuery seems to
So I'm trying to write some code where I basically need to expand an
i'm trying to get this accordion to expand when printed. the code degrades gracefully
I come from a Windows .NET background, but am trying to expand my expertise,
I am trying to use a jQuery plugin to implement Expand all Divs/ Collapse
I was trying to show tree data with JQuery expand and collapse . For
I am trying to use some C# code that expands on the GridView functionality
I am trying to expand the relationships within my Django Models. I have a
I am trying to expand on a basic hello world application for the google

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.