We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5756
    • 5 Posts
    Hi,
    This is my first post anywhere, so beware.
    I’ve created a mock MODx site just to test out how easy it is to implement
    jquery scripts. I’m also brand new to MODx but have been extremely impressed
    by lots of it’s features.
    I’ve managed to get a few jquery scripts to work, s3Slider, Spacegallery and a
    drop down navigation menu.
    Then i created a new page with a new template to make it nice and clean, as i’m
    only experimenting right now.
    Anyway here is the code in the head of the template:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>

    <title>GalleryView in MODx</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link href="/jquery_modx/assets/templates/simply_green2/style.css" rel="stylesheet" type="text/css" />

    <link href="/jquery_modx/assets/templates/simply_green2/style2.css" rel="stylesheet" type="text/css" />

    <script src="/jquery_modx/assets/js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="/jquery_modx/assets/js/jquery.easing.1.3.js" type="text/javascript"></script>
    <script src="/jquery_modx/assets/js/jquery-galleryview-1.1/jquery.galleryview-1.1.js"type="text/javascript"></script>

    <script src="/jquery_modx/assets/js/jquery-galleryview-1.1/jquery.timers-1.1.2.js" type="text/javascript"></script>


    <script type="text/javascript">
    $(document).ready(function(){
    $(’#photos’).galleryView({
    panel_width: 800,
    panel_height: 300,
    frame_width: 100,
    frame_height: 100
    });
    });
    </script>



    </head>
    -------------------------------------------------------------------------------
    -------------------------------------------------------------------------------

    First i’d like to say that I made this script work in a separete folder using all
    the files, css, js, images, etc, on my desktop.
    But when trying it in my MODx site all I get is the text showing, the caption in
    the middle with the images scrolling etc is blank. When I take the jquery code out
    the images in the middle of the page then show up as normal in the content div going
    vertically down the page.
    I’ve checked and rechecked the file paths and am confounded. As I said I made the script
    work out of MODx so I know how the file paths should work.
    Also, i’ve managed to make three other jquery script to work so I know it can be done.
    Would really love a solution to this as this script would look awsome on any site and I
    don’t want to abandon MODx as i’ve been relly impressed so far, especially by the
    awsome tempating system.

    Coolamundo
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      For one thing, if you put code (like HTML code) inside of the code tags (click on the # button in the toolbar above the editing box) it makes your post much easier to read.

      I presume you are logged in as manager when doing this; is the QuickEditor or QuickManger front-end editing plugin active on this page? It uses MooTools, as well as adding its own CSS, and this can cause conflicts with other javascript libraries. There are workarounds, but sometimes it’s easier to disable the plugin if you don’t desperately need it for editing your pages.

        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 5756
        • 5 Posts
        Hi,
        Thanks for your reply. I solved the problem, embarrassingly, it was because I was viewing it with the editor on.
        When I logged out and tried to view it, it was fine. I spent the whole weekend annoyed that I might have to drop MODx as I love the jquery library.
        But like I said other scripts were working fine, even with the editor on, and others would not show at all.

        Thanks
        Coolamundo