We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27330
    • 884 Posts
    hmmm, i’ll give the <base> another try and see if it solves it. you said it used to work on ie when you made the wiki article so I’ll try to play with it. do you have an idea maybe what xpix means with using ajax for it?
      • 7923
      • 4,213 Posts
      It seems that the image tag src attribute change is indeed a problem with IE6. See this: http://www.webdeveloper.com/forum/showthread.php?t=99122

      And for a fix, see: http://www.webdeveloper.com/forum/showthread.php?t=99122&p=695835

      So you need to move the showPic function call from the onClick attribute to the href attribute in the link. I originally put the javascript:void(0) intentionally to the href attribute, because that avoids the browser to go to the top of the page on image change.

      Don’t know if jQuery or other js libraries have some workaround to this issue.. you might want to try and use jQuery to change the image.. you can use it to create nice trasition on image change while you’re at it.

      EDIT: it’s not the <base> url.. and I’m not sure anymore that did it work in IE6 the way it’s in the wiki article, I might of had the js call in the href attribute when testing in IE.. or I used IE7.. sorry.

      EDIT2: eg. include jquery to the gallery document and try replacing the js function with:

      function showPic(url,title,descr,width,height) {
      	$("#maxImage").attr({
      		src: url,
      		width: width,
      		height: height
      	});		
      	$("#maxTitle").html(title);
      	$("#maxDescr").html(descr);
      }


      If that works, spice it up with the jQuery enchant transitions http://ui.jquery.com/enchant/1.0a/demos/ smiley


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 5340
        • 1,624 Posts
        Quote from: sinbad at Apr 28, 2008, 05:42 PM

        yes thats on IE6 only AFAIK. too bad they say 60% still using it tongue

        xpix mind elaborating with some linkage or a direction for me?

        I used mootools for the ajax call http://demos.mootools.net/Ajax

        function showImage(img){
        			var url = "ajax-get-img.php?img=" + img[curImg-1];
        					
        						/**
        						 * The simple way for an Ajax request, use onRequest/onComplete/onFailure
        						 * to do add your own Ajax depended code.
        						 */
        						var log = $('imgPort').empty().addClass('ajax-loading');
        						new Ajax(url, {
        							method: 'get',
        							update: $('imgPort'),
        							onComplete: function() {
        								log.removeClass('ajax-loading');
        							}
        						}).request();
        			}


        ajax-get-img.php should return only <img src="..."> and the container will having the ID imgPort will be updated with the new image
          • 27330
          • 884 Posts
          xpix, thanks for the input. I’ll look into that and see how it goes.
          doze, like always thanks a ton. your replies are always to the point and a great fix. in this particular gallery anyway I don’t have many images and I think it’ll stay that way for a while. I need to look at the jQuery and will post if it worked for me. for now I just change the link in the script and viola its working awesome.

          Thanks thanks thanks!
            • 8960
            • 150 Posts
            I have the same type of issue in IE6, and after reading Doze’s post on URLs, paths, and the <base>, I took a look at mine to try and troubleshoot. What I found was MaxiGallery is calling all images and CSS with href="/assets/ whereas I’m calling all my images and CSS in the template with href="assets/. The difference is absolute vs. relative paths because of the leading / before the path (href="/). Which is the better method, and where do I change the MaxiGallery path if that is the cause of the problem?

            I do have Friendly URLs turned on, and my ’Use friendly alias path’ is set at ’No’, which if I read correctly, would apply the leading / in front of the URLs. For kicks, I’ll change that and see if it makes a difference... and it didn’t.

            I also checked the MaxiGallery snippet, and it didn’t seem to have any leading slashes in the code there, so I’m still wondering where that is coming from?
              • 7923
              • 4,213 Posts
              MaxiGallery uses MODx to build the url (via makeUrl() function in document parser class), but the problem is not the URL’s. See my reply above.


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 8960
                • 150 Posts
                I read through your reply (even before I posted), but I couldn’t figure out where to add or change the jQuery function that you mentioned. Is that a call coming from MaxiGallery, or is that something within MODx. I’ve seen lot of posts about jQuery, but I don’t know anything about it, so I have not read up on it, or how to use it in MODx.
                  • 7923
                  • 4,213 Posts
                  You need to modify the mgGalleryPicture by doing following..

                  change:
                  <a href="javascript:void(0);"
                  onClick="javascript:showPic('[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]','[+maxigallery.picture.title:htmlent+]','[+maxigallery.picture.descr:htmlent+]',[+maxigallery.picture_width_normal+],[+maxigallery.picture_height_normal+]);return
                  false;">


                  to:
                  <a href="javascript:showPic('[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]','[+maxigallery.picture.title:htmlent+]','[+maxigallery.picture.descr:htmlent+]',[+maxigallery.picture_width_normal+],[+maxigallery.picture_height_normal+])">


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 8960
                    • 150 Posts
                    Quote from: doze at May 12, 2008, 02:20 PM

                    You need to modify the mgGalleryPicture by doing following..

                    Ah, the chunk call. That did the trick! Thanks for the fix on that!!