Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: CMotion Image Gallery - script mechanics doesn't move pictures

  1. #1
    Join Date
    Mar 2011
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default CMotion Image Gallery - script mechanics doesn't move pictures

    1) Script Title: CMotion Image Gallery

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...iongallery.htm

    3) Describe problem: Hi, this script is sth I was looking for, to use it on the website I'm working on. But after copying scripts and saving them on the server, it, literally, doesn't move.. It's probably some stupid mistake I should find myself and correct, but after many tries - cannot.



    This is what I've pasted in the <head> of index.html and pro.html files:
    Code:
    <link rel="stylesheet" type="text/css" href="gallerystyle.css" />
          
    <!-- Do not edit IE conditional style below -->
    <!--[if gte IE 5.5]>
    <style type="text/css">
    #motioncontainer {
    width:expression(Math.min(this.offsetWidth, maxwidth)+'px');
    }
    </style>
    <![endif]-->
    <!-- End Conditional Style -->
    
    <script type="text/javascript" src="motiongallery.js">
    
    /***********************************************
    * CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    * Modified by Jscheuer1 for autowidth and optional starting positions
    ***********************************************/
    
    </script>
    This is what I've pasted where the gallery should appear:

    Code:
    <div id="motioncontainer" style="position:relative;overflow:hidden;">
    <div id="motiongallery" style="position:absolute;left:0;top:0;white-space: nowrap;">
    
    <nobr id="trueContainer">
    <a href="javascript:enlargeimage('dynamicbook1.gif')"><img src="dynamicbook1.gif" border=1></a>
    <a href="javascript:enlargeimage('dynamicbook1.gif', 300, 300)"><img src="dynamicbook1.gif" border=1></a>
    <a href="http://www.dynamicdrive.com"><img src="dynamicbook1.gif" border=1></a>
    <a href="#"><img src="dynamicbook1.gif" border=1></a>
    <a href="#"><img src="dynamicbook1.gif" border=1></a>
    <a href="#"><img src="dynamicbook1.gif" border=1></a>
    <a href="#"><img src="dynamicbook1.gif" border=1></a>
    <a href="#"><img src="dynamicbook1.gif" border=1></a>
    <a href="#"><img src="dynamicbook1.gif" border=1></a></nobr>
    
    </div>
    </div>
    And that's the page: http://pracownia.fabianczyk.com.pl. Maybe the problem is that I used a DIV based web, where all pages
    appear inside an index-build-div, with using so called "jah - just asynchronous html".
    Please help me find out what's the problem...

    Regards, Anton


    Well... It started to work.. I was checking if there are any answers in this thread and I saw a slash "/" after a <LINK REL...> line of code:
    HTML Code:
    <link rel="stylesheet" type="text/css" href="gallerystyle.css" />
    So i deleted it - it did nothing. So i retyped it back on its place, and... after refreshing page - the gallery was working perfectly!

    Have no idea what's just happend. If you have any clues...

    Regards, Anton

    ...and again, it got disabled. But - as I've mentiond before, when I delete - upload and retype - upload slash after that LINK REL line, the gallery works. Why?

    Regards, Anton
    Last edited by Anton_PL; 03-06-2011 at 10:30 AM. Reason: 'cause the script is almost working...

  2. #2
    Join Date
    Mar 2011
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    up.. no one can answer that?

  3. #3
    Join Date
    Mar 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi, i am new here, and i am also using the CMotion Image Gallery, I don't see anything wrong with your code. the only explanation that i can come to is that your js file might not be accessible or it is in a different folder.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    At this typing, the actual index.html page, if you look at the live source code view, doesn't have that code from your post on it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2011
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Yeah you're right.

    I changed it, because I didn't know how to fix it. The code was copy-pasted. The only answer that comes to my mind is that using mentioned "jah" to open html files in DIV located in index file makes the script doesn't work. When I open it in a separate window, it works.

    I'm really looking forward to see solution. Now it's just scrolling area - doesn't look bad, but...

    Is anyone here who would at least look at it? I can upload an example that'll show the problem.

    Regards, Anton

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Yes, upload an example that shows the problem.

    However, if this is caused by the "jah", we can only tell you what's wrong/missing. You may have to figure out how to fix it visa vis the "jah" you're using.

    That sounds like AJAX though. If so we could possibly find a way to initialize the gallery after it's imported. I'm thinking a slightly different script (an OO version of cmotion) or even a differnt script (text and image crawler) and a call to init after the imported content arrives. We would want something that doesn't depend upon the onload event, as that is presumably already past once something gets imported asynchronously.

    But put up your demo and we shall see what we can see from it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2011
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Ok, so basically that's it. The page with the problem is here:http://antonczyk.pl/anton/example/
    It contains with 7 files:
    - index.html
    - file1.html
    - style.css
    - thumb.jpg
    - jah.js (for loading file1.html in the DIV called "internal")
    And those from the DDscript:
    - gallerystyle.css
    - motiongallery.js


    After applying the "almost-solution" (deleting the slash in LINK REL line, mentioned in my first post) nothing happens. So that was rather a lucky reaction.

    What is unusual, when using "jah" (yeah, that's AJAX as I can tell), and opening a random *.html file in a DIV, it doesn't matter what lines of code you have in the HEAD section of that random *.html file - my webbrowser (Safari 5, as well as: Chrome, and Firefox 3.6) read it from index.html (the html file, where I recall *.html file into DIV using "jah"). Nevertheless I still keep all needed <HEAD> lines both in index.html and file1.html.

    Hope you could solve it
    Best regards,
    Anton

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Use this modified version of the cmotion script:

    Attachment 3834

    And this mod of your jah script:

    Code:
    var req = null;
    function jah(url,target) {
        // native XMLHttpRequest object
        document.getElementById(target).innerHTML = 'sending...';
        if (window.XMLHttpRequest) {
            req = new XMLHttpRequest();
            req.onreadystatechange = function() {jahDone(target);};
            req.open("GET", url, true);
            req.send(null);
        // IE/Windows ActiveX version
        } else if (window.ActiveXObject) {
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.onreadystatechange = function() {jahDone(target);};
                req.open("GET", url, true);
                req.send();
            }
        }
    }    
    
    function jahDone(target) {
        // only if req is "loaded"
        if (req.readyState == 4) {
            // only if "OK"
            if (req.status == 200) {
                results = req.responseText;
                document.getElementById(target).innerHTML = results;
                fillup();
            } else {
                document.getElementById(target).innerHTML="jah error:\n" +
                    req.statusText;
            }
        }
    }
    Last edited by jscheuer1; 03-30-2011 at 02:19 PM. Reason: minor script update
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Anton_PL (03-30-2011)

  10. #9
    Join Date
    Mar 2011
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Ha! That really works! Amazing - I'm neighter familiar nor truly confident with scripts, so thats really amazing! Thank you John very much!

    Regards,
    Anton

    EDIT:
    Yeah.. After implementing that on my "example" page, it worked, then I put it on my web - it worked. But when I try to make two sepparate CMotion Galleries, the second one isn't working. You can see how it looks like on the example page: http://antonczyk.pl/anton/example

    Hoping for solution,
    Anton
    Last edited by Anton_PL; 03-30-2011 at 05:01 PM. Reason: another issue poped-up..

  11. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That script never did that, even without AJAX. There's Text and Image Crawler:

    http://www.dynamicdrive.com/dynamici...wler/index.htm

    that can do a similar thing, it duplicates the image train though, so there's no 'end of gallery'. It could be adapted fairly easily to your AJAX setup.

    There's also an OO version of cmotion that was introduced here:

    http://www.dynamicdrive.com/forums/s...3998#post53998

    But it requires that the images be defined in a javascript array, so might not be suitable for your purposes. It can run fairly easily under AJAX though, if you're willing to define your images in an array.

    I just had a thought, perhaps it could grab the images for the array(s) from the markup via a front end function. I'll have a look at that possibility when I get a little more time.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •