February 17, 201412 yr Im using an iframe on a Magento site to show a wordpress portfolio. Don't want to use the normal magento/WP integration as that prevents me using the WP template and some features. Have got it all working, also not showing the scroll bar yet still allowing to scroll, looks good. Only thing I need to find to work is that when I click on a portfolio link in the WP iframe, I need it to open in a new window, not still within the iframe... any suggestions? the code Im using is below. <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script> <script type='text/javascript'> $(function(){ var iFrames = $('iframe'); function iResize() { for (var i = 0, j = iFrames.length; i < j; i++) { iFrames.style.height = iFrames.contentWindow.document.body.offsetHeight + 'px';} } if ($.browser.safari || $.browser.opera) { iFrames.load(function(){ setTimeout(iResize, 0); }); for (var i = 0, j = iFrames.length; i < j; i++) { var iSource = iFrames.src; iFrames.src = ''; iFrames.src = iSource; } } else { iFrames.load(function() { this.style.height = this.contentWindow.document.body.offsetHeight + 'px'; }); } setInterval(iResize, 1000); }); </script> <iframe src="/blog2/" class="iframe" width=100% height=100% scrolling="no" frameborder="0"></iframe> This is entered into HTML CMS block within Magento, and shows the WP portfolio page within the Mag template. any help to get it to open portfolio's in a new page would be greatly appreciated! Thanks in advance (hopefully!)
Create an account or sign in to comment