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(){
$('#tabs').tabs();
setTimeout(function(){var $tabs = $('#tabs').tabs("select",'null');
$('#BVSummaryReadReviewsLink').bind("click",function() {
$tabs.tabs('select', 1);
$("html,body").animate({scrollTop: 400}, 750);return false;});
},2000)});</script>

Currently rated 2.0 by 2 people

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

Tags:

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About the author

Derek Curtis Derek Curtis
President, Plaid Pony Technology Solutions LLC

E-mail me Send mail

Calendar

<<  November 2017  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Pages

    Recent comments

    Authors

    Disclaimer

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

    © Copyright 2017

    Sign in