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

    I’m still pretty new to modx, but I’ve chosen to use it to develop a site in it.

    I want to embed a javascript which shows a bunch of photo’s scrolling from right to left.
    The javascript should be visible at all time in one of the div’s of the website.

    However, I don’t have a clue how to accomplish this within Modx. Any clue’s or hints ?

    cheers,
    Unforgiven

    • Last Of The Romans Reply #2, 14 years ago
      easy way is in template, just like static html smiley
        palma non sine pulvere
        • 31051
        • 23 Posts
        Hi,

        Thanks for the input...I’ve tried to put the javascript in the template, but it doesn’t show up in the place I want it too.
        *sigh*....

        You can check my attempt on www.kwestie van.nu. I want to have the pictures appear in the footer. But for some reason they appear in the upmost part of the page.

        It’s frustrating...

        cheers,
        Unforgiven
        • Last Of The Romans Reply #4, 14 years ago
          Quote from: Unforgiven at Apr 14, 2010, 06:23 PM

          Hi,

          Thanks for the input...I’ve tried to put the javascript in the template, but it doesn’t show up in the place I want it too.
          *sigh*....

          You can check my attempt on www.kwestie van.nu. I want to have the pictures appear in the footer. But for some reason they appear in the upmost part of the page.

          It’s frustrating...

          cheers,
          Unforgiven

          where is JS?:
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
          <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
          <head> 
            <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
            <meta name="description" content="Website voor dieet pakketten" /> 
            <meta name="keywords" content="dieet kant en klaar maaltijden gezond sport voeding" /> 
            <meta name="author" content="Bright Byte" /> 
             <base href="http://www.kwestievan.nu/"></base> 
            <link rel="stylesheet" type="text/css" href="assets/templates/andreas00/andreas00.css" media="screen,projection" /> 
            <title>MODx CMS Install Success - A free website template by Andreas Viklund</title> 
           
          </head> 
           
          <body> 
          <div id="wrap"> 
          	<div id="header"> 
          		<h1><a href="#">MODx CMS Install Success</a></h1> 
          		<p><strong>Welcome to the MODx Content Management System</strong></p> 
          	</div> 
           
          <div id="container"> 
          	<div id="leftside"> 
          		<h2 class="hide">Sample menu:</h2> 
          		<ul class="navigation"><li><a href="/index.php?id=3" title="weekmenu's" >Weekmenu's</a></li> 
          <li><a href="/index.php?id=4" title="Kant en klaar maaltijden" >Kant en klaar maaltijden</a></li> 
          <li><a href="/index.php?id=5" title="Bereken uw ideale gewicht" >Bereken uw ideale gewicht</a></li> 
          <li><a href="/index.php?id=6" title="Nieuws" >Nieuws</a></li> 
          <li><a href="/index.php?id=7" title="forum" >forum</a></li> 
          <li><a href="/index.php?id=8" title="Online diëtiste" >Online diëtiste</a></li> 
          <li><a href="/index.php?id=9" title="Korting" >Korting</a></li> 
          <li class="last"><a href="/index.php?id=16" title="Bestelformulier" >Bestelformulier</a></li> 
          </ul> 
          	</div> 
          </div> 
           
           
           
              <div id="content"> 
          		<h3>Install Successful!</h3> 
          <p>You have successfully installed and configured MODx. We hope you find this site an adequate starting configuration for many small business, organization or personal websites; just change out the template and add your own content and snippets, and you'll be good to go! </p> 
          <h3>Getting Help</h3> 
          <p>The <a href="http://modxcms.com/modx-team.html" target="_blank">team behind MODx</a> strives to contantly add to and refine the documentation to help you get up to speed with MODx:</p> 
          <ul> 
          <li>For basic instructions on integrating custom templates into MODx, please see the <a href="http://modxcms.com/designer-guide.html" target="_blank">Designer's Guide</a>. </li> 
          <li>For an introduction to working in MODx from the content editors perspectve, see the <a href="http://modxcms.com/editor-guide.html" target="_blank">Content Editor's Guide</a>. </li> 
          <li>For a detailed overview of the backend "manager" and setting up Users and Groups, please peruse the <a href="http://modxcms.com/developers-guide.html" target="_blank">Administration Guide</a>.</li> 
          <li>For developers, architecture and API documentation can be found in the <a href="http://modxcms.com/administration-guide.html" target="_blank">Developer's Guide</a>.</li> 
          <li>And if someone has installed this site for you, but you're curious as to the steps they went through, please see the <a href="http://modxcms.com/getting-started.html" target="_blank">Getting Started Guide</a>.</li> 
          </ul> 
          <p>And don't forget, you can always learn and ask questions at the <a href="http://www.modxcms.com/forums" target="_blank">MODx forums</a>.</p> 
          	</div> 
           
           
          	<div id="footer"> 
          		<p><span>© 2008 <a href="index.php?id=1">Kwestie Van</a></span><br /> 
          		Content managed by <a href="modxcms.com">MODx</a> - Design by <a href="http://andreasviklund.com/templates/">Andreas</a></p> 
          	</div> 
           
          </div> 
          </body> 
          </html> 

            palma non sine pulvere
            • 31051
            • 23 Posts


            The script is there when you click on one of the links.
            The script works, however, not in the position I want it to be.
            Can somebody give me a tip how to fix this ?
              • 1169
              • 312 Posts
              Should the positioning not be relative to div?
              Never used Java Script
                DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
              • I would do this differently; instead of using "document.write()" I would have an empty container in my footer with an ID attribute of "footerPics", and do something like this

                var picturebox = document.getElementById('footerPics');
                picturebox.innerHTML = '<a href = ' + pic[ii].link + ' target="_blank" ><img space=0 hspace=0 vspace=0 border=0 height=75 style=position:absolute;top:0;left:' + myLeft[ii]  + '; src=' + pic[ii].name + ' onMouseOver=stop() onMouseOut=go()></a>';


                  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
                  • 31051
                  • 23 Posts
                  Hi sotwell,

                  I’ve replaced the document.write with the code you suggested, but now I see nothing....I’m not very familiar with JS, so any help is appreciated...

                  cheers,
                  Unforgiven