We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41049
    • 35 Posts
    Hi..

    fancy box messes my anchor links. So when I click on ancshor link it opens in a box .. I dont want that smiley

    What to do?
      • 38417
      • 92 Posts
      Hi,

      I have got a member page on my site. I would like to achieve that when somebody logs in sekFancyBox shows a newsletter before opening the member page. Something like shown here: http://jsfiddle.net/Py2RA/ is this possible?

      Ad.
        • 37286
        • 160 Posts
        Short answer is yes, it can be done. Long answer is that I have not built that functionality into the addon yet, but there is a little trick you can use to get around that. If you place a [[!sekfancybox]] somewhere on the page to load the default js and css files, then you can create some custom js and load at the end of your page with an onload event.

        Something like this might work:
        $(document).ready(function() {
          $.fancybox('Some text to display.');
        });
        
          • 38417
          • 92 Posts
          Got it working!

          I created a chunck with this code:
          <script>window.onload=function(){$(document).ready(function() {
            $.fancybox('Hier komt de nieuwsbrief. Onder constructie.');
          });};</script>

          and put it in the resource together with [[!sekfancybox]] and it is functioning.

          Thank you for your help!
            • 37286
            • 160 Posts
            no prob
              • 38417
              • 92 Posts
              It was much simpler.
              I got a new chunk with this code:

              <script type="text/javascript">
              $(document).ready(function() {
                $.fancybox('Hier komt de [[sekfancybox? &type=`iframe` &linktext=`nieuwsbrief` &link=`http://www.ceciliahandel.nl/assets/components/sekfancybox/demo/iframe.html`]]. Onder constructie.'); 
              });
              </script>


              This is functioning by clicking on the link text. Is it possible the link opens automatically, so the newsletter appears direct in the pop up?
                • 46577
                • 54 Posts
                I'm having problems getting sekfancybox to run reliably on my site and have tried all sorts of tricks to no avail.

                Using Firefox 27, it will work occasionally. Seems to run the first time after I make changes, then reverts to opening the link in a new page.
                In Chrome and Opera, it just doesn't work at all.

                Here's my call:

                [[sekfancybox? &loadjquery=`0` &type=`iframe` &linktext=`<img src="assets/images/icon-trail.png" alt="map of run <?php echo $row_runs['run']; ?>" title="map of run <?php echo $row_runs['run']; ?>" align="absmiddle"/>` &link=`assets/php/runmap.php?run=<?php echo $row_runs['run']; ?>` &title=`Route for Run <?php echo $row_runs['run']; ?>`]]

                I noticed from the page source that when it does work in Firefox, jquery is loaded twice even though I am specifically asking sekfancybox not to load jquery. It doesn't seem to matter whether I use &loadjquery=`0` or &loadjquery=`1` (tried &loadjquery=`true` and &loadjquery=`false` as well)
                <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
                <script type="text/javascript" src="/modx/assets/components/sekfancybox/lib/jquery-1.10.1.min.js"></script>
                <link rel="stylesheet" href="/modx/assets/components/sekfancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" />

                On the page loads where jquery is NOT loaded twice in Firefox (also in Chrome and Opera where it is never loaded) it doesn't work.

                <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

                Any insights or suggestions would be greatly appreciated...
                  • 11681
                  • 98 Posts
                  grogorio,

                  MODX does not allow inline PHP code, such as the scripts with the 'echo' statements embedded in your call's &linktext, &link and &title properties. This might not contribute to the problem you report, but it is not correct. I am surprised that MODX is willing to process the sekfancybox call even a single time with those embedded PHP scripts.

                  For sake of debugging, try substituting immediate values that you would expect those 'echo' scripts to produce. If that clears up your reported problem, you can create your own snippet that returns the desired values and substitute it for those three inline PHP 'echo' scripts.

                  Also, please consider writing your call in a more easily read format: Each property can appear on its own line. MODX doesn't care, but this is helpful to the human reader. [ed. note: halfnium last edited this post 10 years, 2 months ago.]
                    I looked just like that in 1964.
                    • 36762
                    • 45 Posts
                    Any idea why sekFancyBox doesn't seem to be available in the Revo Package Manager (v2.3.1)?