jquery .click event not firing in IE7

by dcurtis 3/30/2009 12:27:00 PM

So I started using jquery for the first time on a project for one of my clients.  I added the code and everything was working great in google chrome, IE 8 and Firefox; however, when I tried it in IE 7, the code wouldn't work.  I was trying to add a "click" event to a hyperlink on a control that is generated via an iframe after the page loads.  For whatever reason, the click event wouldn't fire no matter what I did in IE 7.  I was adding the event in the window.load event so I thought it would work fine in all browsers; however, it appears that in IE 7 the load event was firing before the iframe had populated the div on the page.  Finally, I thought I would delay the binding of the event for two seconds hoping that would resolve the issue, and it worked like a charm!  The following is the code that I used:

<script type="text/javascript">
$(window).bind('load', function(){
setTimeout(function(){var $tabs = $('#tabs').tabs("select",'null');
$('#BVSummaryReadReviewsLink').bind("click",function() {
$tabs.tabs('select', 1);
$("html,body").animate({scrollTop: 400}, 750);return false;});

Currently rated 2.0 by 2 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Derek Curtis Derek Curtis
President, Plaid Pony Technology Solutions LLC

E-mail me Send mail


<<  June 2018  >>

View posts in large calendar


    Recent comments



    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2018

    Sign in