Skip to content Skip to sidebar Skip to footer

Jquery - Trigger('click') Not Working In Ie - Object Does Not Support This Property Or Method

I have an images with a fading overlay div on hover which displays a text link within. When the link is clicked it opens a shadowbox with content. I want the whole overlay div to b

Solution 1:

Which version of ie are you using ? I remember that some version of IE don't support clicking objects other than links or buttons :(

perhaps try with a mousedown event as a workaround

Solution 2:

I wouldn't recommend this approach. Why can't you call the function which handles your anchor's (link's) click event? Or navigate using location from your link. That would make more sense.

Solution 3:

$("div.overlay").each(function(i,n){                
         $(n).click(function(e){
             //do not need "a" in front of it as #overlink is unique anyways
             $('#overlink').trigger('click'); // id of shadowbox linkreturnfalse;

             });


       });

try this and note my comment above your trigger

Solution 4:

Have you tried:

 $('a#overlink').click();

Solution 5:

Try this:

$("div.overlay").each(function(){                
  $(this).click(function(){
      var $elm = $('a#overlink');
      if (document.createEvent) {
        var e = document.createEvent('MouseEvents');
        e.initEvent( 'click', true, true );
        $elm.get(0).dispatchEvent(e);
      }
      else {
        $elm.trigger("click");
      }
     returnfalse;
  });
});

Post a Comment for "Jquery - Trigger('click') Not Working In Ie - Object Does Not Support This Property Or Method"