views:

51

answers:

3

It was working fine on Firefox on local machine but when I uploaded the files online it just stopped animating and showing a static image.

View it here

The Javascript I am using:

<script type="text/javascript">
$(document).ready(function() {

$("ul.gallery li").hover(function() { //On hover...

    var thumbOver = $(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'

    //Set a background image(thumbOver) on the <a> tag - Set position to bottom
    $(this).find("a.thumb").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});

    //Animate the image to 0 opacity (fade it out)
    $(this).find("span").stop().fadeTo('normal', 0 , function() {
        $(this).hide() //Hide the image after fade
    });
} , function() { //on hover out...
    //Fade the image to full opacity 
    $(this).find("span").stop().fadeTo('normal', 1).show();
});

});</script>

any idea why its happening ! Solution ??

A: 

After looking at your page, I see the images try to swap, then swap back almost immediately. It looks like you're having the second function of the .hover() being called as the image is swapping.

palehorse
A: 

Actually, this is interesting, if you remove the ad bit at the end of the page:

<div style="text-align: center;">[...]</div>

Then it works fine.

You can try it live in firebug..

EDIT: re-actually, if you just delete the image in the ad and leave the wrapping it works too...

Ben
no i dint added any ad, I'm testing on a free server thats coming from them ... not in my control.
Shikeb Ali
I understand, but it seems the ad, or whatever is injecting it is somewhat responsible. If you delete the element in firebug then suddenly everything works fine.
Ben
+1  A: 

Correction: After looking at your site, it appears that your images are not located where you are looking.

Instead of:

../images/gthumb01.png

change it to:

/images/gthumb01.png

Because your images are located in the /New/images/ directory

http://shikeb.izihost.org/New/images/gthumb01.png

alt text

fudgey