Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-15-2010, 06:40 PM   PM User | #1
attasz
New Coder

 
Join Date: Nov 2009
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
attasz is an unknown quantity at this point
Jquery rollover problem

Hy there! I wrote this code:
PHP Code:
$(document).ready(function(){
    $(
".piece img").hover(function(){
        var 
num parseFloat(this.id) + 
        this
.src "mintak/minta" num "_big.jpg"
        
$(this).removeClass()
        $(
this).addClass("bigimg");
    },function(){
        var 
num parseFloat(this.id) + 
        this
.src "mintak/minta" num "_small.jpg"
        
$(this).removeClass();
        $(
this).addClass("smallimg")
    })
}) 
I know it's not the neatest code ,but works perfectly on localhost in all browsers,but if i upload it to my webhost (it's a free host),onmouseover gives me a rough version of the _big.jpg then both the _small and the _big picture dissapears.Can the free host cause this?I mean maybe it's too slow?
I can't figure it out.I tried to preload the images,i don't know if it's the proper way to do it:
PHP Code:
<script type "text/javascript" src "http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type = "text/javascript" src = "demo.js"> //source of the code above
         <!--hide from none JavaScript Browsers

            Image1= new Image()
            Image1.src = "mintak/minta1_big.jpg"
            Image2= new Image()
            Image2.src = "mintak/minta2_big.jpg"
            Image3= new Image()
            Image3.src = "mintak/minta3_big.jpg"
            Image4= new Image()
            Image4.src = "mintak/minta4_big.jpg"
            Image5= new Image()
            Image5.src = "mintak/minta5_big.jpg"
            Image6= new Image()
            Image6.src = "mintak/minta6_big.jpg"
            Image7= new Image()
            Image7.src = "mintak/minta7_big.jpg"
            Image8= new Image()
            Image8.src = "mintak/minta8_nagy.jpg"
            Image9= new Image()
            Image9.src = "mintak/minta9_big.jpg"
            Image10= new Image()
            Image10.src = "mintak/minta10_big.jpg"
            Image11= new Image()
            Image11.src = "mintak/minta11_big.jpg"
            Image12= new Image()
            Image12.src = "mintak/minta2_big.jpg"
    

        // End Hiding --></script> 
Any help appreciated
attasz is offline   Reply With Quote
Old 01-17-2010, 03:51 PM   PM User | #2
attasz
New Coder

 
Join Date: Nov 2009
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
attasz is an unknown quantity at this point
Important

IMPORTANT!!!
I got the solution from another forum, from a guy called libeco:
my big picture's file extension was, JPG (uppercase) this caused the problem,i had to rename them to jpg (lowercase) because maybe my host runs some linux version which is case sensitive.
I thought this is important,since i spent at least 12 hours triing to make the script work without any success.
attasz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:05 AM.


Advertisement
Log in to turn off these ads.