Jump to content

simple jQuery problem.. hopefully!


Chud37

Recommended Posts

Hello,

 

I have an external jquery.shop.js file, and there are three pages where I need a donation box to popup.  I built it on the first page, and it works fine, looks beautiful, etc.  But when I implement the same code on the other two pages, it refuses to popup.  I know the jquery file is referenced correctly and loading, because other functions in there are performing on the other pages too.  But i cannot get any response out of it.

 

It confuses me, because the code is the same, both in the HTML and the Jquery.  What is stopping the [.click] function from performing?

 

here is the code:

 

$('#donateButton').click(function(){
alert('hello');
if(popupStat==0) {
popupStat=1;
$('#donationPopup').center();
$('#donationPopup').fadeIn('slow');
$('#content').fadeTo('slow', 0.2);
}
});
$('#closeButton').click(function(){
if(popupStat==1) {
popupStat=0;
$('#donationPopup').fadeOut('slow');
$('#content').fadeTo('slow', 1);
}
});

I put the alert hello in there to try and debug somewhat, and again, i get the alert on the first page, but the second and third pages are not showing anything at all. 

 

I am fairly new to jQuery, but not to programming.  But this seems to be a re-occuring problem for me.  Does it make a difference in what order my functions are placed in the .JS file? how could i further debug this?  Can anyone help?

 

Thanks,

 

~Richard

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.