I am working on magento 2 and i want to open popup in my product detail page. But i have found problem with jquery issue and its not come every time.
Here is my requirejs-config.js
var config = {
map: {
'*': {
jQuerylib: 'Magento_Catalog/js/jquery-1.12.5.min',
colorbox: 'Magento_Catalog/js/jquery.colorbox-min',
}
}
};
And my js function on wrapper.phtml
requirejs(['jquery','domReady!','colorbox'], function(jQuery){
jQuery( ".scustomization a" ).click(function() {
jQuery.colorbox({
width: "90%",
height: "90%",
iframe: true,
href: _url + coString,
opacity: 0.6,
escKey: false,
overlayClose: false,
onComplete: function() {
var theframe = jQuery('#colorbox').find('iframe')[0];
theframe.src = _url + coString + "&t=" + d.getTime();
}
});
return false;
});
});