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 8123913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:18:35+00:00 2026-06-06T06:18:35+00:00

I am building a site for experiment and I am having trouble with some

  • 0

I am building a site for experiment and I am having trouble with some code.

The next button works but the previous button doesn’t. It basically swaps the first two divs with the class “tri” but not the other one.

I cannot understand why one works and the other one doesn’t.

I have tried prependTo and before but neither work properly?

Feel free to look at the code here:

HTML: http://epicgiggle.co.uk/test/-testtwo/index.html

CSS: http://epicgiggle.co.uk/test/-testtwo/style.css

jQuery: http://epicgiggle.co.uk/test/-testtwo/custom.js

Thanks in advance!

  • 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-06T06:18:36+00:00Added an answer on June 6, 2026 at 6:18 am

    What a lot of work you’re doing, moving the text and CSS attributes individually. Far easier to move the divs themselves. (.insertBefore and .insertAfter are the methods you need in this particular case.)

    $(".prev").click(function() {
            $('.tri').last().insertBefore( $('.tri').first() );
    });
    $(".next").click(function() {
            $('.tri').first().insertAfter( $('.tri').last() );
    });
    

    http://jsfiddle.net/mblase75/Dnwvy/2/

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

Sidebar

Related Questions

I'm building a site to display my comics- but I've read some tutorials (
Building a site super quick and having it work on all my Mac browsers,
Building a site on CargoCollective, but it appears they use jQuery 1.4.2 which seems
I am building this site for a friend, every page looks correct but in
I am building a site and i need to retrieve some information. I have
I'm building a site with a simple navigation bar. I've written some CSS to
I am building a site using code igniter. I am developing a custom product
I am building a site right now using the new siFR3 it works perfectly
I am currently building a site with Expression Engine. I have just put some
building a site using PHP and MySQL that needs to store a lot of

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.