Jump to content

Calling a javascript function


jamjam

Recommended Posts

Hi

 

This is very silly question, but can someone please tell what is wrong.

 

I have a small piece of javascript code

 

Here it is.

 

google.load("jquery", "1.3.1"); 
jQuery.fn.fadeToggle = function(speed, easing, callback) { 
  return this.animate({opacity: 'toggle'}, speed, easing, callback);   
}; 

$(document).ready(function() { 
    $('#tellfriend').hide(); 
      $('li a.email, #tellfriend a.close').click(function() { 
    $("#tellfriend").fadeToggle('slow'); 
  }); 
   
}); 

Once a email icon button is clicked this code fades in a email form.

 

The associated html looks like this

 

<li><a class="email" href="#tellafreiend" alt="Email" id="emails">Email</a></li> 

This all works.

 

 

But I need to change the associated html to something like this

 

 

 

<li><a href="#tellafreiend" alt="Email"><img src="/files/email.png" alt="Email"/></a></li> 

However once I do this the fade in effect no longer works and I do not see the email form.

 

I know the problem is properly a result of incorrect class or id.

But I cannot fix it.

 

 

Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.