Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #167329

    Hi there
    I have a chart with external links I would like them top open in a style similar to this link when you click on one of the calculators (with the window resized to the content)
    Thanks so much for your help
    Trace

    #167334

    Hi Trace!

    I didn’t fully understand you, can you please be more specific? perhaps an example link?

    Best regards,
    Josue

    #167335

    Shoot, 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
    Trace

    #167345

    Hi 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,
    Josue

    #167624

    Thanks so much Josue. Where do I go to put the code? In the avia_framework.php file?
    I appreciate your help!
    Trace

    #167726

    Hi!

    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!
    Josue

    #168325

    Hi 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!
    Trace

    #168331

    OOPS. I just answered the section question on my own. But the first question still stands. :)

    #168338

    Hello!

    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!
    Josue

    #168355

    Thanks 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.

    #168390

    Hi!

    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

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Open link in new window and resize window to fit content’ is closed to new replies.