This topic is locked

Custom Modal

12/11/2014 6:27:26 AM
PHPRunner General questions
T
Tempus_Erus author

Hi
I have attempted to use an external program to generate a 'window' which calls a page from within PHPR.
I generally would use iBox but this fails to load other than setting the back ground dark as should happen.
Looking for an alternative I found a very lightweight version called Pico.
The common theme is that I cannot get the 'window' to execute as should and I have tried 3 libraries to date. I have absolutely no issues in reproducing 'windows' outside the PHPR environment....
The latest piece of code I am playing with as follows....
<script src="modal/picoModal.js"></script> (path is correct for JS file)
<script>

function buildModal(id, options) {

var modal;

document.getElementById(id)

.addEventListener("click", function(e) {

e.preventDefault();

if ( !modal ) {

modal = typeof options === "function" ?

options() :

picoModal(options);

}

modal.show();

});

}

buildModal("createFromString", "<iframe src=address width=500 height=500 frameborder=0></iframe>");

</script>
Function can be called by <a href="#" id="createFromString">Testwin</a>
This is all quite simple and should be achievable however there has to be a fundamental error on my part why tis will as said not execute from within PHPR.
I am totally stumped at the moment and any direction would be fantastic.
Thanks all.

Sergey Kornilov admin 12/11/2014

To be honest, I don't know why would someone use a third party library instead of using built-in popups functionality:

http://xlinesoft.com/blog/2013/04/25/displaying-a-page-in-a-popup-window/
This was tested and allows you to avoid all sorts of unknown issues.
Anyway, if you need/want to use something else check for Javascript errors using Chrome Developer Tools or Firebug. Can point you in the right direction.

T
Tempus_Erus author 12/11/2014



To be honest, I don't know why would someone use a third party library instead of using built-in popups functionality:

http://xlinesoft.com/blog/2013/04/25/displaying-a-page-in-a-popup-window/
This was tested and allows you to avoid all sorts of unknown issues.
Anyway, if you need/want to use something else check for Javascript errors using Chrome Developer Tools or Firebug. Can point you in the right direction.


Thanks for the quick reply.
I avoid using the built in library as not as easily configurable as others available. I have also found it can render inconsistently and on occasions I have found the pop up quite slow to respond.