-
AuthorPosts
-
September 27, 2013 at 11:31 pm #167329September 27, 2013 at 11:59 pm #167334
Hi Trace!
I didn’t fully understand you, can you please be more specific? perhaps an example link?
Best regards,
JosueSeptember 28, 2013 at 12:05 am #167335Shoot, I put a link in and I must have deleted it. If you go to this page http://www.lighthousewealth.ca/calc.html and click on one of the calculators it opens in another window to the size of the calculator. And actually, my links are going to the exact same pages on Mackenzie Wealth (it’s a page used by many in the financial industry)
Thanks Josue
TraceSeptember 28, 2013 at 12:53 am #167345Hi Trace!
It’s because their links are already configured to open that size:
<a href="javascript:newWindow('http://www.mackenziefinancial.com/rrspcalculator','RRSPcalculator','','620','400')"> RRSP Calculator</a>
Including links like that won’t work in Enfold, unless you include the newWindow function too (this could be put at the end of the js/avia.js file):
function newWindow(contentsURL, winName, winProps, width, height) { if (!winName) var winName = "CALCULATOR"; if (!winProps) var winProps = "menubar=0,toolbar=0,resizable=0,location=0,status=0,scrollbars=0"; if (!width) var w = 620; else w = width; if (!height) var h = 400; else h = height; var x = 100; y = 100; var args = "width=" + w + ",height=" + h + "," + winProps + ",screenx=" + x + ",screeny=" + y + ",left=" + x + ",top=" + y; window.open(contentsURL, winName, args); }
Best regards,
JosueSeptember 28, 2013 at 8:53 pm #167624Thanks so much Josue. Where do I go to put the code? In the avia_framework.php file?
I appreciate your help!
TraceSeptember 28, 2013 at 11:41 pm #167726Hi!
Put the large code at the end of js/avia.js, like this:
.
Then just put a link element like this anywhere you want:
<a href="javascript:newWindow('http://www.mackenziefinancial.com/rrspcalculator','RRSPcalculator','','620','400')"> RRSP Calculator</a>
The result:
Cheers!
JosueSeptember 30, 2013 at 8:05 pm #168325Hi Josue,
Sorry, feeling like an idiot here. For the life of me I do not know how to get to the screen you entered that content.AND, do I put “ RRSP Calculator” for each link or does this “blanket cover” all links opening in another window?
Slowly but surely learning how to do this.
Thanks!
TraceSeptember 30, 2013 at 8:13 pm #168331OOPS. I just answered the section question on my own. But the first question still stands. :)
September 30, 2013 at 8:25 pm #168338Hello!
I understand this is way too technical, but it’s quick to accomplish, i can do it for you if want, send me an administrator account to (Email address hidden if logged out) (include a link to this topic).
Cheers!
JosueSeptember 30, 2013 at 8:52 pm #168355Thanks Josue, I would really like to do this myself so I actually learn as I’m planning on doing more and more of this instead of farming it out. If you could direct me to it that would be great, if it’s ok by you.
September 30, 2013 at 9:41 pm #168390Hi!
You need to open the avia.js (with a text editor) file which is located at the js folder in the theme directory.
After that, scroll down to the bottom and add this block of code:
function newWindow(contentsURL, winName, winProps, width, height) { if (!winName) var winName = "CALCULATOR"; if (!winProps) var winProps = "menubar=0,toolbar=0,resizable=0,location=0,status=0,scrollbars=0"; if (!width) var w = 620; else w = width; if (!height) var h = 400; else h = height; var x = 100; y = 100; var args = "width=" + w + ",height=" + h + "," + winProps + ",screenx=" + x + ",screeny=" + y + ",left=" + x + ",top=" + y; window.open(contentsURL, winName, args); }
Then, you just need to add the link (to the calculator) wherever you want, as HTML:
<a href="javascript:newWindow('http://www.mackenziefinancial.com/rrspcalculator','RRSPcalculator','','620','400')"> RRSP Calculator</a>
Best regards,
Josue -
AuthorPosts
- The topic ‘Open link in new window and resize window to fit content’ is closed to new replies.