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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:39:24+00:00 2026-05-20T12:39:24+00:00

Hey guys I’m trying to create a function and call it inside another each

  • 0

Hey guys I’m trying to create a function and call it inside another each loop. I got it to work, but the each loop is not working. So I tried to add an extra $(this) and it didn’t work either…any help is appreciated.

.moveClass {
position:relative;
}

$(function() {

$('.a_projectLoad').each(function(evt){
    $(this).hover(function(){
        $(this).slideRight();
    });
});

});

function slideRight () {
    $('.img_rightArrow')
        .addClass('moveClass')
        .animate({"left": "+=50px"}, "fast");
}

<table>
             <tr>
                <td><a href="#" class="a_projectLoad">Title Goes Here</a></td>
                <td ><img src="images/btn_loadProject.png" class="img_rightArrow"/></td>
              </tr>
              <tr>
                <td><a href="#" class="a_projectLoad">Title Goes Here</a></td>
                <td><img src="images/btn_loadProject.png" class="img_rightArrow"/></td>
              </tr>
</table>
  • 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-20T12:39:25+00:00Added an answer on May 20, 2026 at 12:39 pm

    Add the position: relative attribute to your images directly as part of the markup rather than programmatically via JavaScript. This will not alter its initial rendering and therefore should not be done in code.

    Next, bind a custom slideRight event and invoke it on hover as follows:

    $(function() {
    
        // Bind a custom slideRight event to each image
        $('img.img_rightArrow').bind({
            slideRight: function () {
                $(this).stop(true, true).animate({"left": "+=50px"}, "fast");
            },
            slideLeft: function () {
                $(this).stop(true, true).animate({"left": "-=50px"}, "fast");
            }
        });
    
        $('a.a_projectLoad').hover(function () {
            // Traverse DOM to find nearby arrow image
            $(this).closest("tr").find("img.img_rightArrow").trigger("slideRight");
        }, function () {
            $(this).closest("tr").find("img.img_rightArrow").trigger("slideLeft");
        });
    
    });
    

    FYI: your images are missing the img_rightArrow class in the sample markup.

    You could probably use a second functional parameter to .hover() to bind to the mouseout event. Check out the documentation for more information. I assume in your example it might be something of the sort of a trigger to a slideLeft event. Just a thought however.

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

Sidebar

Related Questions

Hey guys I wanted to create a JScrollPane but it won't work... and I
Hey guys. I am trying to get the selected option in an each loop.
Hey guys, am trying to write to do type casting in java, but i
hey guys having this really simple problem but cant seem to figure out have
hey guys was hoping you could help me out, Not sure if I always
Hey guys got an issue with Cakephp validation.. I want to know why is
hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
Hey guys i'm making a website but for some reason my div tags are
Hey guys I'm trying to add the string 'url( ) ' around my a
Hey guys, I'm trying to get my head around LINQ and FP, so forgive

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.