简体   繁体   English

警报脚本正常工作,没有警报脚本则不工作

[英]on alert script working and without it not working

If some body can answer. 如果有身体可以回答。

 <script type="text/javascript">
$(document).ready(function(){
    //alert("Before..");
    $('#myGallery').galleryView({
        panel_width: 960,
        panel_height: 424,
        frame_width: 160,
        frame_height: 70,
        panel_scale: "nocrop",
        frame_opacity: 0.6,
        pause_on_hover: true
    });
    //alert("AFter....");    

    $('#homeGallery').innerfade({
            speed:900,
            timeout: 8000 
    });

});
</script>

above is the code it is not working 上面的代码不起作用
if I remove the alert("before.") it will work. 如果我删除了alert(“ before。”),它将起作用。

I have run into similar issues before and it always suggests a race condition. 我以前也遇到过类似的问题,它总是暗示着比赛条件。 Although you should be fine because you have a document.ready ... to test this, try putting that call into a setTimeout( function(), 1000) and let me know what happens 尽管您应该有一个document.ready ...来进行测试,但您应该没事,但是请尝试将该调用放入setTimeout( function(), 1000)然后让我知道会发生什么

Can you trying clearing your browser cache. 您可以尝试清除浏览器缓存吗? If that doesn't work can you provide the HTML schema 如果这样不起作用,您可以提供HTML模式吗

This could be an issue with some required parts of the document not having been loaded yet. 尚未加载文档的某些必需部分可能是一个问题。 After you have dismissed the dialog, they have and the code works. 取消对话框后,它们就会出现并且代码可以正常工作。

Have you tried using document.load instead of document.ready ? 您是否尝试过使用document.load而不是document.ready

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM