tags:

views:

20

answers:

1

Hi Friends i was using the following jquery,but it is not gaving an output what is the error in the code?

$('.event').hover(function() {
  $('.popupbox1').show();
  $('.popupbox1').css({position:'absolute',top: $(this).offset().top - 15 +'px',left: $(this).offset().left + $(this).width() +25 +'px',zIndex:1000});
,function() {
  $('.popupbox1').hide();
});
+1  A: 

You had a missing } and the 'px' entries were unnecessary. Give this a shot:

$('.event').hover(
  function() {
    $('.popupbox1').show();
    $('.popupbox1').css({position:'absolute',
                         top: $(this).offset().top - 15,
                         left: $(this).offset().left + $(this).width() + 25,
                         zIndex:1000
                       });
  },
  function() {
    $('.popupbox1').hide();
  }
);
Fosco
Thats works....thks...
Alex Mathew
@Alex it really helps to format things better. In it's original form, the missing `}` would be a lot harder to locate.
Fosco
Fosco: actually it is a output from php,so that make it harder to format,thks for let me know where was the error ;)
Alex Mathew