Announcement

Collapse
No announcement yet.

Random Image when new page opens .. that old chest nut

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Mash,

    You've missed the closing " from my correction in post 12.

    You've probably done the same thing with bannerright as you did with bannerleft.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #17
      As you can guess I really do not understand this script, I have done something to it that does work which is great but some times two images appear it looks like the same cell of the table but there is not pattern to it and same image which is double can also be single.

      Running the two banners could it be that if the results are the same the second image will apprear, just guessing. Anyway there are no working examples as I had to remove the test site.

      Anyway thanks.
      Mash

      Comment


        #18
        and extra tip

        As this relates to this thread...

        If you refer to one or more images in a JavaScript array, you may find that Actinic does not notice them - and so does not upload them. Make sure you add them via Design/Additional Files.

        And although the local path may be images/image1.jpg etc, they will end up in acatalog/image1.jpg etc - so get the path right too!

        [I still have *some* hair left]

        Comment


          #19
          Missing final quote at end of this line

          str+="><img src=\"http://www.organicplants.co.uk/images/banners/"+banner[ num ]+"\" border=\"0\" alt=\""+alt[ num ]+"\" /></a>;

          change to ....</a>";
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #20
            Another YahooSections images question

            Hi I was wondering whether it was possible to use the YahooSections function to return / echo a set of variables, which are picked up by a dynamic image changer such as the one on dyn-web..

            http://www.dyn-web.com/code/rotate_i...ate_random.php

            I have made a start with the variables, but I can't seem to get them to load into the dynamic image code from dyn-web. It would make a very nice feature to have a dynamically changing image that refers to the current section images.

            In <HEAD>

            Code:
            <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
            
            function YahooSections(ar)
            {
            var strIms = "[";
            var strUrls = "[";
            var stralt = "[";
            
            for (var i=1;i<=ar.length;i++)
              {
              if (ar[i].sURL != null)
                {
                strIms += '"' + ar[i].sImage + '"' + ',';
                strUrls += '"' + ar[i].sURL + '"' + ',';
                stralt += '"' + ar[i].sName + '"' + ',';
            		{
                  if (ar[i].pChild)
                    {
                    for (var j=1;j<=ar[i].pChild.length;j++)
                      {
                      if (ar[i].pChild[j].sURL != null)
            		{
            		strIms += '"' +ar[i].pChild[j].sImage + '"'+ ',';
            		strUrls += '"' + ar[i].pChild[j].sURL + '"' + ',';
            		stralt += '"' + ar[i].pChild[j].sName + '"' + ',';								{
            		if (ar[i].pChild[j].pChild)
            							{
            								for (var k=1;k<=ar[i].pChild[j].pChild.length;k++)
            								{
            									if (ar[i].pChild[j].pChild[k].sURL != null)
            										{	
            									strIms +=  '"' +ar[i].pChild[j].pChild[k].sImage + '"' + ',';			strUrls += '"' + ar[i].pChild[j].pChild[k].sURL + '"' + ',';			stralt += '"' + ar[i].pChild[j].pChild[k].sName + '"' + ',';
            								}
            							}	
            					
            					}
            				}
                      }
                    }
                  }
            }
            strIms += "]" ;
            strUrls += "]" ;
            stralt += "]" ;
            }
            }
            }
            var rotator1 = {
                path: '/', 
                speed:  3000, // default is 4500
                id: 'r1',
                bTrans: true,
                bMouse: true,
                bRand:  true,
                images: return strIms
                actions: return strUrls
                title: return stralt
            
            	}
            
            function initRotator() {
                dw_Rotator.setup(rotator1);
            }
            
            dw_Event.add( window, 'load', initRotator);
            
            </script>

            In <BODY>

            Code:
            <a href="index.html"><img id="r1" src="smile.gif" alt="" title="That's a nice smile!" border="0"></a>

            Is there a way of passing the variables using php??


            Please help

            Comment


              #21
              Adapting random image function

              Hi, I've just implimented the random image function of Norman's and i works great. I just have one question as to if the functionality can eb changed.

              I'm trying to get the random image function working on my 4 promotional fragments on our homepage : classixshop dot com.

              If all the fragments use the random image function, everytime the page is refreshed each fragment will generate the same image (not what i'm wanting)

              Could i have 4 layouts (one for each fragment) and each fragment can randomly pull an image from what it is assigned?

              ie:

              fragment (1) - assigned images 1-3 random image

              fragment (2) - assigned images 4-6 random image

              fragment (3) - assigned images 7-9 random image

              ect ect.

              this way each fragment will never generate the same image twice on the same page.

              Let us know if there's a better way of achieveing this with the random image function, or any usfull tips Cheers FrAz
              Cheers FrAz

              Comment


                #22
                just implimented the random image function of Norman's
                Without a link or you posting to the code you refer to it's hard to help.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #23
                  sorry Norman our test site shows you whats going on, it's the fragments @ the bottom of the page:

                  www dot classxishop dot com /acatalog/test/acatalog/
                  Cheers FrAz

                  Comment


                    #24
                    Just a 404 at that URL.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #25
                      it's ok at my end: give it another bash
                      Cheers FrAz

                      Comment


                        #26
                        Worked it out. classxishop isn't you. Remove the bit of code from above the </head> area and put it into every Fragment, just above the other bit of JavaScript that displays the images.

                        When you've got that working amend the second two Fragments to use different sets of image variables.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment


                          #27
                          Cool, cheers Norman, new it was something simple along those line. Any problems i'll give you a shout. :P
                          Cheers FrAz

                          Comment


                            #28
                            I have setup the random image function. on three fragments and a header banner. each image having three images to choose from. At the moment i'm up to 12 ramdom images, but once i go over 10 images i'm prompted by an error. Does the javascript needed to be adapted in rder to hold more that 10 images? Any clues would be helpful as i'd love to get this function working to my disired affect

                            I've attatched the error i'm being given: Cheers FrAz
                            Attached Files
                            Cheers FrAz

                            Comment


                              #29
                              You need the same number of links in the cvlinks list as you have images in the cvimages list.
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment


                                #30
                                I'm prity sure i tried it with both the image and link variables in the array. So i tested it again and i'm met with the same error.

                                I've uploaded on our trial site, which could you some insight as to whats going on. The header randon image is the one thats playin up.

                                Cheers FrAz
                                Attached Files
                                Cheers FrAz

                                Comment

                                Working...
                                X