2010-07-14 96 views
0

我在公司网站(http://www.pershing.com/events/customer_conference/register/index.html)上从第三方提取注册表单。jQuery/iframe上的后退按钮

  • 用户选择他们所属的类型并点击“下一步”。
  • 在这一点上,他们被要求输入他们的信息。

该问题发生在用户点击“返回”时。由于页面没有被刷新,iFrame不会调整大小。

有人可以帮我吗?我可以在“后退”和“下一步”按钮中添加某种类型的“点击”功能吗?谢谢。

回答

0

假设nextback按钮有一个id(如果他们不这样做,我不知道是否有可能做你想要的):

var iframe=$('iframe#iframe_id');//iframe id 
iframe.load (function(){ 
    var next_button=iframe.contents().find("#next"); 
    var back_button=iframe.contents().find("#back"); 

    next_button.click(
    function(){ 
     alert('next clicked');//just to test 
     //add resize code here 
    }); 

    back_button.click(
    function(){ 
     alert('back clicked');//just to test 
     //add resize code here 
    }); 
}); 
+0

感谢Stormdrain。 – Rocky 2010-08-12 13:36:52

+0

即使他们没有ID,你也可以通过某种方式找到他们,比如在iframe中选择:nth-​​child按钮或者使用eq() – mazlix 2011-06-17 16:16:34