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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:30:12+00:00 2026-05-25T22:30:12+00:00

I am trying to add this jQuery Hover effect to my site. Instead of

  • 0

I am trying to add this jQuery Hover effect to my site. Instead of downloading jQuery I decided to use Google Libraries API for jQuery. I got a key and copied the code that goes to the header then I copied the jQuery for the hover effect but nothing is happenning. What am I doing wrong? This is where my test page is and below is the complete code and the handler:

class JQueryTest(webapp.RequestHandler):
    def get(self):
        self.response.out.write("""<html>""")
        self.response.out.write("""<head>""")
        self.response.out.write("""<script type="text/javascript" src="https://www.google.com/jsapi?key=GOOGLE LIBRARIES API KEY"></script>""")

        self.response.out.write("""<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">

$("ul.thumb li").hover(function() {
    $(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
    $(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
        .animate({
            marginTop: '-110px', /* The next 4 lines will vertically align this image */ 
            marginLeft: '-110px',
            top: '50%',
            left: '50%',
            width: '174px', /* Set new width */
            height: '174px', /* Set new height */
            padding: '20px'
        }, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

    } , function() {
    $(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
    $(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
        .animate({
    marginTop: '0', /* Set alignment back to default */
            marginLeft: '0',
            top: '0',
            left: '0',
            width: '100px', /* Set width back to default */
            height: '100px', /* Set height back to default */
            padding: '5px'
        }, 400);
});
 </script>""")

        self.response.out.write("""<link type="text/css" rel="stylesheet" 
                                    href="/stylesheets/jquery.css" /> """)
        self.response.out.write("""<title>JQuery Test</title>""")
        self.response.out.write("</head>")
        self.response.out.write("""<body>""")
        self.response.out.write("""<div class="content">""")

        self.response.out.write("""
        <ul class="thumb">
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGIfcCww" alt="" /></a></li>
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGIyGCww" alt="" /></a></li>
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGIm1Cww" alt="" /></a></li>
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGM-dCww" alt="" /></a></li>
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGM6dCww" alt="" /></a></li>
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGIuGCww" alt="" /></a></li>
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGLrzCww" alt="" /></a></li>
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGLWlCww" alt="" /></a></li>
        <li><a href="#"><img src="http://ting-1.appspot.com/image?img_id=agZ0aW5nLTFyEAsSCEhvbWVQYWdlGLWlCww" alt="" /></a></li>
        </ul>""")

        self.response.out.write("""</div>""")
        self.response.out.write("</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-25T22:30:13+00:00Added an answer on May 25, 2026 at 10:30 pm

    You’re not wrapping your jQuery code in $(document).ready(), so the DOM doesn’t exist yet at the time you’re trying to attach the handlers. In general, any time you need to reference DOM elements in the page (as opposed to just defining functions to be called later), you have to wrap it all in a .ready() callback so that it won’t run until the DOM is completely loaded. Try this:

    $(function() {
        $("ul.thumb li").hover(function() {
                // ...
            }, function() {
                // ...
            });
    });
    

    That should work – it does here: http://jsfiddle.net/nrabinowitz/gdsxH/1/

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

Sidebar

Related Questions

I'm trying to add a simple fade in/out effect to the buttons by jQuery
I am trying to use jquery to add a class to my css menu
I'm trying to add some share this javascript in between the head tags of
I'm trying add a tab to my web page that looks like this: Using
I've encountered this problem (while trying to add SQL Server Database (.mdf) file to
I'm trying to add parameters to an objectDataSource at runtime like this: Parameter objCustomerParameter
I am trying to add an KeyPress event in a textbox (WinForm) this.textBox1.KeyPress +=
I'm trying to add a publisher policy file to the gac as per this
This may be a simple answer, but I'm trying to add a dom-created element
I am trying this in my Form Load Event cmdCancel.Attributes.Add(onClick, document.forms[0].reset();return false;) but it

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.