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

  • Home
  • SEARCH
  • 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 9180253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:00:00+00:00 2026-06-17T18:00:00+00:00

I have a script that works for the slider. But now I need to

  • 0

I have a script that works for the slider. But now I need to rotate an arrow image with the HTML like this:

http://jsfiddle.net/nicorellius/gsDVS/

The image I’m using is currently a background image on the class, byline.

The jQuery script is here:

// expanding, collapsing div script
$(document).ready(function() {
    $(".toggle-content").hide();
    $(".byline").click(function() {
        //$(this).attr("id", "down-arrow");
        var $next = $(this).next(".toggle-content");
        $(".toggle-content").not($next).slideUp();
        $next.slideToggle(500);
        //$next.attr("id", "");
    });
});

This works to change the image from left to down, eg, id from empty to down-arrow. But when I click to close the slider, the image stays as left. I’m getting confused on how to rework this script to change the image back. The images currently are separate, one facing left and the other facing down. I should probably use a single image sprite, but I’m just trying to get this figured out first.

I read this post and this is a good idea, but maybe a bit too complex for me right now to implement:

Rotate image on toggle with jQuery

Thanks.

EDIT

I should note that my page in question here is a bit different than the fiddle I showed:

<div class="byline">
    <h4 class="crp-h">Analyze</h4>
    <p class="crp-p">Things are written here</p>
</div>

<div class="toggle-content">
    <ul class="crp-list">
        <li>Statistical</li>
        <li>Robust</li>
    </ul>
</div>

Thanks One Trick Pony… this thing is almost working except for one thing. The rotation only works when the this div is clicked. When the non-this div is clicked the other divs hide but the image remains un-rotated:

.byline{
  position:relative;     /* required */
}    


.byline:after {
    transform: rotate(-90deg);
    content: '';           /* required */
    position:absolute;     /* required */
    width: 14px;           /* required, width of your arrow */
    height: 14px;          /* required, height of your arrow */
    right: -20px;          /* required, negative width + some padding */
    top:0;                 /* required */
    background: url('your/arrow/image/here.png') no-repeat;
}

.byline.exp:after {
    transform: rotate(0deg);
}

The new jQuery is here:

// expanding, collapsing div script
$(document).ready(function() {
    $(".toggle-content").hide();
    $(".byline").click(function() {
        var $next = $(this).next(".toggle-content");
        $(".toggle-content").not($next).slideUp();
        $next.slideToggle(500);
        $(this).toggleClass('exp');
    });
});

The fiddle showing this is here:

http://jsfiddle.net/nicorellius/7AYjj/

  • 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-06-17T18:00:01+00:00Added an answer on June 17, 2026 at 6:00 pm

    Put the arrow graphic on an pseudo-element like :after, and transform it, based on a class that you toggle on the trigger link:

    .byline:after{
        transform: rotate(-90deg);
        /* arrow as background here */
    }
    
    .byline.exp:after{
        transform: rotate(0deg);
    }
    

    in your click event add:

    $(this).toggleClass('exp');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this script that works, but I need to change the format of
With help from you guys I now have a script that works like a
I have this jQuery script that works fine: $(select).change(function () { var finalPrice =
I have a simple images resizing script that works great for JPEGs, but not
I have the following code that works fine in IE: <HTML> <BODY> <script language=JavaScript>
We have a ubuntu test server that this simple script works fine on where
I have a content slider script that works fine for me in FF, IE
I have a script that works great. It is quite complex and does numerous
I have the following script that works well in Firefox and Chrome (not sure
I have a script on here that works fine in FF14 and Chrome20. A

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.