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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:44:44+00:00 2026-06-12T21:44:44+00:00

I have a very basic jQuery script that slides a title from bottom to

  • 0

I have a very basic jQuery script that slides a title from bottom to top after the page loads. The problem I’m having now is that I need to make this title to only slide if the user is on the ‘main page’. If the user then clicks on any sub-pages I need the title to remain to the top of the page.

Example: wordpress website with a few pages on which I have galleries. When a user enters a page -> animate title. When the user is browsing the gallery -> static title.

This is the jQuery script:

jQuery(document).ready(function () {
jQuery(".animate").addClass("move"); 
});

You can see the website in question here.

// later edit: Thanks everyone for helping! I forgot to mention that I have multiple URLs, there are multiple pages. Is there a way I can get the “current URL” of the page and then append to it the extra bit which will always be the same i.e. /?pid=xx ?

Example: I need to animate the title on pages with this format:

mywebpage/custom_name/

Then, on pages with this format, I need to keep the title static:

mywebpage/custom_name/?pid=xx

Following the answers bellow I made this script:

if(window.location.href == 'http://www.noahd.net/demo-upwall/residential/rooftop-garden/'){
    jQuery(document).ready(function () {
        jQuery(".animate").addClass("move"); 
    });
} else {
    jQuery(document).ready(function () {
        jQuery(".portfolio-title-wrap").removeClass("animate").addClass("top"); 
    }); 
}

This script works only for the /residential/rooftop-garden/ page. Under residential I have another 10 pages. And then I have another 6 pages starting from root, like /commercial/ or /objects which also have 6-10 sub-pages.

How can I adapt the above script to work on those pages and sub-pages but not on the sub-sub-pages?

  • 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-12T21:44:46+00:00Added an answer on June 12, 2026 at 9:44 pm

    You can decide behavior of your page based on url.

    code:

    if(window.location.href== mainapplicationurl){
    
        // slide code
    }
    else{
          // put title on top
    
    }
    

    After edit of question. you can decide pages based of count of ‘/’ in url( will work only if url format is consistent).

    var count = window.location.href.split("/").length;
    jQuery(document).ready(function () {
       if( count < 7 ){        
            jQuery(".animate").addClass("move"); 
       } else {        
            jQuery(".portfolio-title-wrap").removeClass("animate").addClass("top"); 
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a very basic JQuery script accompanied by some CSS that helps
I have written a very basic jquery script that is true theorically but not
I have a very basic data class that is subclassed from NSObject. I declare
I have a very basic jquery mobile modal dialog that INTERMITTENTLY reloads on clicking
I'm learning javascript and jquery and have written a very basic script inside my
I have a very basic script that sets up datepicker on three of my
Using JQuery 1.2.6, testing from Firefox 3 and IE7. I have a very basic
I have a very basic mysql table called memberships, that tracks which people belong
I have some very basic semaphore code that works great on Linux, but cannot
I have a very basic doubt regarding the method that gets executed when app

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.