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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:03:40+00:00 2026-06-13T15:03:40+00:00

I am trying to use jQuery to animate the full-page (html) background by clicking

  • 0

I am trying to use jQuery to animate the full-page (html) background by clicking the menu buttons. I created a small try-out in W3school TryIt Editor, and this worked. However, when I want to use it on my own site, it doesn’t work (and the jQuery stops working in general – the alert doesn’t show anymore as well).Is there anyone that can help me with this?

This is the error Firebug gives me:

SyntaxError: missing ) after argument list
[Break On This Error]   

$('.html').animate(left:'0px')

script.js?mcplzp (line 32, col 35)

This is my actual JS code:

$('.html').animate(left:'0px'

    (function ($, Drupal) {
        $("<link/>", {
       rel: "stylesheet",
       type: "text/css",
       href: "../css/pages.css"
    }).appendTo("head");

    if (jQuery) {  
        alert('jQuery is loaded!');  
        };

    $(document).ready(function()
    {
        $('.menu-704').click(function() 
            {
                $('.html').animate(left:'0px'
            });
    });

    $(document).ready(function()
    {
        $('.menu-797').click(function() 
            {
                $('.html').animate(left:'=+1250px'
            });
    });

    $(document).ready(function()
    {
        $('.menu-359').click(function() 
            {
                $('.html').animate(left:'=+1250px'
            });
    });

    $(document).ready(function()
    {
        $('.menu-796').click(function() 
            {
                $('.html').animate(left:'=+1250px'
            });
    });


    })(jQuery, Drupal);
  • 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-13T15:03:41+00:00Added an answer on June 13, 2026 at 3:03 pm

    You may want to try the following, which I’ve tested and it seems to work.

    1) Your animate method should be called like this:

    $('.html').animate({left:'+=1250px'})
    

    Not like this:

    $('.html').animate(left:'=+1250px')
    

    The CSS properties and values you’re passing (in this case ‘left’ positioning) should be wrapped in bracket {} notation.

    2) Try replacing:

    =+
    

    With:

    +=
    

    3) if you’re targeting the html element, you may not want to use a class of ‘html’ on the element itself. Since you’ll only have one html element per document, try doing this instead:

    $('html').click(etc...
    

    4) If you implement the changes outlined in 1 – 3, this should fix your issue. However, once resolved you may want to clean-up the code a bit which will certainly help in debugging issues next time ’round. You only need one $(document).ready(function(){}); within which you’ll set all of your $(‘foo’).click() event listener stuff.

    So instead of this:

    $(document).ready(function()
    {
        $('.menu-797').click(function() 
        {
            $('.html').animate({left:'+=1250px'});
        });
    });
    
    $(document).ready(function()
    {
        $('.menu-359').click(function() 
        {
            $('.html').animate({left:'+=1250px'});
        });
    });
    
    $(document).ready(function()
    {
        $('.menu-796').click(function() 
        {
            $('.html').animate({left:'+=1250px'});
        });
    });
    

    Simplify to this:

    $(document).ready(function()
    {
        $('.menu-797,.menu-359,.menu-796').click(function() 
        {
            $('.html').animate({left:'+=1250px'});
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use jquery to animate between two images, fading one out then
I am trying to use the background animate method in JQuery but it just
I'm trying to use jQuery.scrollTo plugin with accordion (where one block expands after clicking
I'm trying to use jQuery UI tabs much like a Master Page in ASP.Net.
I'm trying to use jQuery SVG plugin http://keith-wood.name/svg.html And in the very beginning I
I'm currently trying to use Quicksand, a jquery plugin that allows you to animate
I'm trying to use jQuery rotate to animate an image once it's containing anchor
I am trying to use min-height with jQuery.animate like this: $insert.animate({ min-height : 52
I'm trying to use jquery to ease scroll to anchors when clicking on a
I can't figure out how to use a variable in jquery's animate function. I'm

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.