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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:08:43+00:00 2026-05-20T18:08:43+00:00

I’ve got a minor problem with my jQuery gallery, and I assume it’s related

  • 0

I’ve got a minor problem with my jQuery gallery, and I assume it’s related to if statement.
You can see how it works here:
http://mojbastovan.com/gallery/lightbox.html
What I want to do is to show description bellow the picture each time I put a mouse over it, however, that doesn’t work. Try opening an image and you’ll see that when you put your mouse over the bigger image you don’t see its description bellow, but when you move the mouse away from image, and put it back over everything works flawlessly.
So what’s the problem? I have even added the if statement but it doesn’t work, so can anyone help me out with this one?
Oh, and another question, does show, hide and animate functions work choppy for you in Chrome? I’ve tested it on several browsers, and it seems that Chrome renders those functions bit choppy.
Here’s my code:

$(document).ready(function() {
$("#box, #box2, #black, #bgal, #pic, #button").hide();
    $("#main img").click(function(){
        $("#load").show()
        finished=false;
    //  alert($("#slike").children().size())
    broj=$("#main img").index(this)+1;
    x=$(this).attr('src');
    $.getJSON('baza.json', function(json){
    $.each(json.slike, function(i,v){
        if (v.t_sr==x){
            nsrc=v.sr;
            info=v.info;
            detail=v.detail;
            zamena(nsrc);
     //$("#pic img").attr('src',v.sr);

        }
        if ((broj > 2) && (broj < 9)) {
            $("#slike").animate({
                left: -152 *(broj-3)
            }, 200)
        }
    else if (broj<3){
        $("#slike").animate({
                left:0
            }, 200)
    }
    else if (broj>8){
        $("#slike").animate({
                left: -152 *5
            }, 200)
    }
    });
    });
$("#black").show(200, function(){
    $("#bgal").show(200);
});
    });
$("#slike img").click(function(){
    $("#pic").hide(function(){
        $("#load").show();
    });
    //  alert($("#slike").children().size())
    broj=$("#slike img").index(this)+1;
    if ((broj > 2) && (broj < 9)) {
            $("#slike").animate({
                left: -152 *(broj-3)
            }, 200)
        }
    else if (broj<3){
        $("#slike").animate({
                left:0
            }, 200)
    }
    else if (broj>8){
        $("#slike").animate({
                left: -152 *5
            }, 200)
    }
    x=$(this).attr('src');
    $.getJSON('baza.json', function(json){
    $.each(json.slike, function(i,v){
        if (v.t_sr==x){
            nsrc=v.sr;
            info=v.info;
            detail=v.detail;
            zamena(nsrc);
     //$("#pic img").attr('src',v.sr);

        }

    });
    });
     $("#black").show(200, function(){
    $("#bgal").show(200);
});
       });
    $("#pic img").mouseover(function(t){
clearTimeout(t);
$("#info").text(info);
$("#detail").text(detail);
if (finished == false) {
    $("#box2").dequeue().stop(true, true).show('slide', {
        direction: 'down'
    }, 100);
    $("#box").dequeue().stop(true, true).show('slide', {
        direction: 'down'
    }, 100);
}
    });
    $("#pic img").mouseout(function(){
t=setTimeout("$('#box2, #box').dequeue().stop(true,true).hide('slide', {direction: 'down'}, 100);",50)

    })
     $("#button").mouseover(function(){
$("#button img").attr("src","images/button.png");
  })
   $("#button").mouseout(function(){
$("#button img").attr("src","images/buttono.png");
   })
   $("#button").click(function(){
$("#bgal").hide(100,function(){
        $("#black").hide(100);
        $("#pic").hide();
    });
    });
     $("#box2").mouseover(function(){
clearTimeout(t);
    })
    $("#box2").mouseout(function(){
    t=setTimeout("$('#box2, #box').dequeue().stop(true,true).hide('slide',        {direction: 'down'}, 100);",50)
});
     });
   //FUNKCIJE
    function zamena(nsrc){
$("#pic").hide();
nimg=new Image;
nimg.src=nsrc; // mora podesena promenljiva iz gl programa
nimg.onload = function(){
    $("#load").hide()
    $("#pic img").attr('src',nimg.src);
    $("#pic").show(1);
    $("#button").show();

}
   }
  • 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-20T18:08:44+00:00Added an answer on May 20, 2026 at 6:08 pm
     $("#pic img").mouseover(function(){
        clearTimeout(t);
        $("#info").text(info);
        $("#detail").text(detail);
        if (finished == false) {
            $("#box2").dequeue().stop(true, true).show('slide', {
                direction: 'down'
            }, 100);
            $("#box").dequeue().stop(true, true).show('slide', {
                direction: 'down'
            }, 100);
        }
      })
    

    Have you tried adding a t within the function?
    $("#pic img").mouseover(function(t){

    Also I believe you need to add a semicolon at the end of the function. Try:

    $("#pic img").mouseover(function(t){
        clearTimeout(t);
        $("#info").text(info);
        $("#detail").text(detail);
        if (finished == false) {
            $("#box2").dequeue().stop(true, true).show('slide', {
                direction: 'down'
            }, 100);
            $("#box").dequeue().stop(true, true).show('slide', {
                direction: 'down'
            }, 100);
        }
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from

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.