Chrome/Safari(Webkit)中的JQuery叠加层无法进行更改 [英] JQuery Overlay in Chrome/Safari (webkit) unable to make changes

查看:136
本文介绍了Chrome/Safari(Webkit)中的JQuery叠加层无法进行更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google上花了几天的时间来寻找答案之后,我转向了应该开始的人们.我已经安装并使用Overlay并取得了巨大的成功.问题在于能够对覆盖视图进行jQuery更改.它可以在IE和FF中完美运行,但不能在Chrome或Safari(webkit)中运行.我意识到Webkit内置了安全保护,但是视图与网站的其余部分位于同一服务器上.我做错了什么?有什么技巧可以绕过这些证券?任何提示都会有所帮助.如果成功完成此操作,请提供示例代码.如果可能的话,我今天需要完成此工作.该示例是所用代码的摘录. 谢谢, 拉尔夫

After spending several days on Google trying to find an answer, I am turning to the people that I should have started with. I have installed and am using Overlay with great success. The problem is being able to make jQuery changes to the overlay view. It works perfectly in IE and FF but will not work in Chrome or Safari (webkit). I realize that there are security protections built in webkit, but the view is on the same server as the rest of the website. What am I doing incorrect? Are there any tips on bypassing these securities? Any tips will help. If you have done this successfully, please include sample code. I need to finish this up today if at all possible. This sample is an excerpt of the code being used. Thank you, Ralph

var triggers = jQuery("input[rel]").overlay({
        mask: {
            color: '#ebecff',
            loadSpeed: 200,
            opacity: 0.9
        },
        effect: 'apple',
        onBeforeLoad: function() {
            // grab wrapper element inside content
            var wrap = this.getOverlay().find(".contentWrap");
            var link = "index.php?page=account.billing&option=com_virtuemart";

            //Add the link and style attributes to the basic iframe
            //jQuery(theframe).attr({ src: link, style: 'height:650px; width:760px; border:none;' });
            jQuery(theframe).attr({ src: link, style: 'height:700px; width:840px; border:none;' });

            //Write the iframe into the wrap
            wrap.html(theframe);

        },
        onLoad: function(){
            var inFrame = this.getOverlay().find("#innerFrame");
            jQuery(inFrame).contents().find('form').attr('onsubmit','window.parent.CloseOverlayFromIframe();');



        }
    });

推荐答案

在使用外部样式表来防止Safari 3+和Chrome(基于WebKit的浏览器)中出现不可预测的行为时,请不要对document.ready()事件使用Apple效果.删除effect: 'apple',时,您将看到它可以在Safari和Chrome中使用.

Do not use Apple effect upon document.ready() event when using external stylesheets to prevent from unpredictable behaviour in Safari 3+ and Chrome (WebKit-based browsers). You will see it works in safari and chrome when you remove effect: 'apple',.

该网站建议两种解决苹果效应的方法:

The site advises two way to solve it for apple effect:

  • 改为使用$(window).load().肯定会在样式表加载后执行.
  • 直接在页面上或元素的内联中定义叠加样式.

页面的末尾.

这篇关于Chrome/Safari(Webkit)中的JQuery叠加层无法进行更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆