January 18th, 2013LWMW: Can I change the footer dynamically for each modal window?
Knowledge Base support case for Likno Web Modal Windows Builder, abstracted and stripped of all user’s private info.
Initial Email From: Quy
Initial Email Subject: Web Modal Windows - API
Support Case Month: March 2012
http://www.likno.com/jquery-modal-windows/api.php
Reading the API, I don't know where to change/add the parameters. Please provide instructions.
Thanks.
Reply From: Likno Customer Support
Hello,
Can you please give me more information on what you want to achieve?
The generic idea is that you can call the modal window directly by using JavaScript:
Modal_Window_1();
And you can pass different properties there:
Modal_Window_1({width:'500px',height:'400px'});
If you have something specific in mind, please let me know so that I can better help you.
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Reply From: Quy
Hello,
I will be using PHP. The multi by links will be dynamically generated via PHP/MySQL. I want to display a multisheet of images where the header/footer pertain to the image (sheet). There will be a Like link in the footer. Would it be possible to click the Like link and the current sheet be refreshed with an Unlike link plus the number of likes without dismissing the modal window completely?
Thanks,
Quy
Reply From: Likno Customer Support
Dear Quy,
Everything is possible but this would require custom coding on your side. You could for example give the “like counter” a specific ID and when you click on “like/unlike” you could directly edit this through JavaScript and also change “like” to “unlike” and vice-versa.
I am afraid however that this is completely out of our support scope (as it is not really related to the modal window itself or its API) so I cannot really help you on the implementation details.
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Reply From: Quy
Yes I understand. I can do the custom coding but I couldn't tell from the API doc where to insert the parameters to change the header/footer text for each sheet in a multi link window. I wish there was an actual sample so I can see it in action. Is there one?
Reply From: Likno Customer Support
Hello again,
I am afraid that it is not possible to have a different footer per sheet in the modal.
You can generally use the API to change the footer of the modal, but nor “per sheet”.
In order to change the footer of the modal you would need something like this:
Modal_Window_1({footer:{text:"new footer"}});
Or along with other parameters:
Modal_Window_1({footer:{text:"new footer"}, width: "200px", height: "300px"});
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Reply From: Quy
I understand the parameters and how to modify them but where to insert them. Do I add it to the onclick attribute? I am on my iPhone so I am unable to test it out.
Reply From: Likno Customer Support
Yes, the onclick property of a page element would be an ideal place to put your code.
Similarly, you could put it anywhere you would put JavaScript code e.g. in the body “onload”, or “onmouseover” of some item, or simple within a <script> tag to be executed immediately. Especially for the last case, please make sure that the modal library has loaded first. A typical way to check for this would be:
if (typeof Modal_Window_1 == "function") Modal_Window_1();
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Reply From: Quy
Sorry for being dense. I am just not getting it. How to modify the following to replace the footer text?
<a href="viewtopic.php?id=44390" target="Modal_Window_1_multi_links">Click here</a>
Thank you!
Reply From: Likno Customer Support
Hello,
Unfortunately you cannot use the “page links” method together with the API, so you cannot have “multi_links” AND change the footer at the same time.
If you want a single-sheet Modal with a custom footer, you can do something like this:
<a href="javascript:void(0);" onclick="Modal_Window_1({bodySource:'<div externalUrl="viewtopic.php?id=44390"></div>', footer:{text:'new footer'}});">Click here</a>
Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook – Follow us on Twitter
Tags: footer, function, header, html, JavaScript, jquery, onClick, onload, onmouseover, parameters, PHP. Mysql, properties, script, tooltip, website