Jquery having two effects on same div!

Jquery having two effects on same div!

Hi all!

I am new to Jquery so go easy on me!  I have written a bit of code that works for the most part, however, when the #JSb is clicked it can trigger two different actions when clicked...but I only created one!  When you click anywere but the top left corner of the div the entire screen fades out (this is not the effect that I want).  If you click in the top left corner the action that I want actually occurs.  I have this working for 4 other divs perfectly and no matter how many times I go through the code or copy and paste over this code it continues to have the same problem.  Please help!

Here is the JQuery code:

  1. amtzoom = 1.8;
  2. scfadein = 1000;

  3. $(document).ready(function() {
  4. $('#JSlc').click(function(e) {
  5. //e.preventDefault();
  6. e.stopPropagation();
  7. ojst = parseInt($(this).css('top'));
  8. ojsl = parseInt($(this).css('left'));

  9. var clcw = ($(window).width() - $(this).width()*amtzoom)/2;
  10. var clch = ($(window).height() - $(this).height()*amtzoom)/2;
  11. var lch = parseInt($(this).css('height'));
  12. ojslch = lch + "px";
  13. var nlch = lch * amtzoom + "px";
  14. var lcw = parseInt($(this).css('width'));
  15. ojslcw = lcw + "px";
  16. var nlcw = lcw * amtzoom + "px";
  17. var cflc = parseInt($(this).css('font-size'));
  18. ojsflc = cflc + "px";
  19. var nflc = cflc + 12 + "px";

  20. $(this).css({'overflow':'visible'});

  21. $(this).siblings().animate({'opacity':"0"},300);
  22. $(this).animate({
  23. 'font-size': nflc, 
  24. 'height': nlch, 
  25. 'width': nlcw, 
  26. 'top': clch + 'px', 
  27. 'left': clcw + 'px'
  28. },300, function(){

  29. $('#JSb').animate({'opacity':"1"},scfadein);
  30. $('#JSscl').delay(100).animate({'opacity':"1"},scfadein);
  31. $('#JSscul').delay(200).animate({'opacity':"1"},scfadein);
  32. $('#JSscu').delay(300).animate({'opacity':"1"},scfadein);
  33. $('#JSscur').delay(400).animate({'opacity':"1"},scfadein);
  34. $('#JSscr').delay(500).animate({'opacity':"1"},scfadein);
  35. $('#JSscrd').delay(600).animate({'opacity':"1"},scfadein);
  36. //$('#JSscd').delay(700).animate({'opacity':"1"},scfadein);
  37. });
  38. });
  39. });

  40. $(document).ready(function() {
  41. $('#JSb').click(function(e) {
  42. //e.preventDefault();
  43. e.stopPropagation();
  44. //$('#JSscd').animate({'opacity':"0"},scfadein);
  45. $('#JSscrd').delay(100).animate({'opacity':"0"},scfadein);
  46. $('#JSscr').delay(200).animate({'opacity':"0"},scfadein);
  47. $('#JSscur').delay(300).animate({'opacity':"0"},scfadein);
  48. $('#JSscu').delay(400).animate({'opacity':"0"},scfadein);
  49. $('#JSscul').delay(500).animate({'opacity':"0"},scfadein);
  50. $('#JSscl').delay(600).animate({'opacity':"0"},scfadein);
  51. $('#JSb').delay(700).animate({'opacity':"0"},scfadein, function() {

  52. $('#JSlc').css({'overflow':'hidden'});
  53. $('#JSlc').animate({
  54. 'font-size': ojsflc, 
  55. 'height': ojslch, 
  56. 'width': ojslcw, 
  57. 'top': ojst + 'px', 
  58. 'left': ojsl + 'px'
  59. },300);
  60. $('#JSlc').siblings().animate({'opacity':"1"},300);
  61. });
  62. });