Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
306 views
in Technique[技术] by (71.8m points)

jquery - View contents of cart inside Fancybox, blank page only in IE8

I'm using Mal's Cart and I want the View Cart link to show the cart contents inside a Fancybox window. This works in Windows Firefox 18, Chrome 24, Opera 12, and Safari but in IE8 the fancybox will pop up blank, refreshing the box will show the content. Turn Compatibility View on and it works fine.

http://www.riptest.info Using IE8, click the "Buy A License" button on the first post and it works, then click the "View Cart" button in left sidebar and it pops up a blank page, refresh the white page and it shows the content.

Code for Buy A License button:

<a href="http://www.riptest.info/fancyboxtest.html" class="iframe rollover"><span class="displace">Buy A Beat</span></a>

Code for sidebar.php View Cart button:

<a href="http://ww11.aitsafe.com/cf/review.cfm?userid=D886658" class="iframe"><img src="http://www.rockitpro.com/misc/viewcart.gif" width="130px" height="20px" alt="View Your Cart" border="0px"></a>

footer.php code (before </body>):

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="http://www.riptest.info/wp-content/themes/acosmin-v3/fancybox/source/jquery.fancybox.pack.js?v=2.1.4"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".iframe").fancybox({
'fitToView': false,
'autoSize': false,
'scrolling': 'no',
'maxWidth': 820,
'maxHeight': 600,
'width': 800,
'height': 600,
'type':'iframe'
    });
});
</script>

I understand it's probably the cart link and my fancybox code isn't set up for that type of link? This is past my know-how so I'm looking for some help. I have 2 available options for the view cart button http://www.mals-e.com/tpv.php?tp=2 but getting Fancybox to work with a form seems a lot more complex than it needs to be, the hyperlink SHOULD work in IE8 since it does in all other browsers right?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I do not know why, but in this case, disabling preloading fixes your IE issue.

 $(".fancybox").fancybox({
     iframe : {
         preload: false
     }
 });

See - http://jsfiddle.net/hwvqf/1/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...