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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:39:56+00:00 2026-06-17T17:39:56+00:00

Fairly new to JavaScript and very new to jQuery. Can someone have a look

  • 0

Fairly new to JavaScript and very new to jQuery. Can someone have a look at the following code and see where I am going wrong.

This is the main part of the jQuery code:

$(document).on("hover", ".crrightcontainer img", function() { /* trigger event on hover on an img in class crrightcontainer */
    var src = $(this).attr('src'); // get full path and filename from thumbnail
    var index = src.lastIndexOf('/') + 1; // get index to last occurrenace of file path delimiter "/"
    var fullsizeimgname = src.substr(index); // get actual filename only i.e. "cs1.jpg"
    fullsizeimgname = "/painted/fp-images/" + fullsizeimgname; // add path to give full path to the full sized image.
    $('.crleftcontainer img').animate({opacity: 0.0},1000); // fade out old full size image
    $('.crleftcontainer img').attr("src",fullsizeimgname).animate({opacity: 1.0},1000); // set full size image in browser and fade in
 });

http://jsfiddle.net/deanflyer/CfxyJ/1

It works, it just seems to fire off multiple mouse events. Just move the mouse a few times over the thumbnail images and youll see what I mean, giving multiple fades.

I’ve tried using .stop() on the main image with animate() but this just stops everything.

Many Thanks.

  • 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-17T17:39:58+00:00Added an answer on June 17, 2026 at 5:39 pm

    Is something like this your requirement try this: http://jsfiddle.net/CfxyJ/13/

        $('.crrightcontainer img').css('opacity', 0.7); 
    
    $('.crrightcontainer img').mouseenter(function () { 
        $(this).stop().animate({opacity: 1.0}, 600);
        var src = $(this).attr('src'); 
        var index = src.lastIndexOf('/') + 1; 
        var fullsizeimgname = src.substr(index);
        fullsizeimgname = "http://thepaintedtree.co.uk/fp-images/" + fullsizeimgname;  
        $('.crleftcontainer img').fadeOut('slow', function(){
            $('.crleftcontainer img').attr("src", fullsizeimgname).fadeIn('slow');
        });
    });
    
    $('.crrightcontainer img').mouseleave(function () { //fadeout
        $(this).stop().animate({
            opacity: 0.7
        }, 600);
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a very basic question. I'm learning Javascript, and I'm fairly new to
I'm fairly new to javascript and jquery development. I have a table of values
I'm fairly new to JavaScript/jQuery, but have made a script to change the background
I'm fairly new to JavaScript/jQuery/AJAX, so I suspect the issue is some typo I'm
First let me preface this question by saying that I'm fairly new to Javascript.
I'm fairly new to JavaScript and I'm cleaning up some JavaScript code I downloaded.
I'm fairly new to Javascript/JQuery. I'm trying to write an app that takes text
I'm fairly new to JavaScript and am trying to write some code that lists
I'm fairly new to Javascript development so this might be a real newbie question.
I'm fairly new to javascript and have a question about how to get a

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.