1
基本上,我试图设置一个页面,以便当一个链接被点击时,它将在iframe中打开,但父页面的URL将更新与哈希但iframe的网址将是原点击url(没有散列)。我达到了初始点击事件起作用的地步。但更改事件(如果用户直接链接到页面)不起作用。这里是我的代码片段:jquery地址和iframes
$j('.products-grid .item a, .post a').click(function(){
$details.fadeIn().addClass('active');
$j.address.value($j(this).attr('href').substr(2));
$details.animate({left:detailGap}, { duration: 500, easing: 'easeInOutExpo'});
});
}).change(function(event) {
$iframe.attr('src', event.value);
$details.fadeIn().addClass('active');
$details.animate({left:detailGap}, { duration: 500, easing: 'easeInOutExpo'});
var loadurl = location.origin + location.pathname +location.hash.substr(1);
alert(loadurl);
$iframe.attr('src', loadurl);
});
即:为URL,http://www.url.com/product-1(iframe网址) 我希望它显示为http://www.url.com/#/product-1(页面URL) 这是在Magento。
感谢,罗伯特