Announcement

Collapse
No announcement yet.

Collapso & Images

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

    Collapso & Images

    Hi Normam (or someone else!),

    I am trying to modify the collapso js so that instead of the +/- images that are to the left of the text, it displays the appropriete section image instead. I have added 'NETQUOTEVAR:SECTIONIMAGE' in the correct place, but it isnt working.

    Is this possible to do, or can netquotevar's not get picked up inside js, or maybe as its in not in a section when its building the menu, it doesnt know what I am looking for?

    Thanks,
    Paul.

    #2
    Hi - Answered my own question. I am using the sImage variable for it. Will post a copy of my changes later in this post if anyone is searching for this.

    Comment


      #3
      That's way beyond what Collapso was designed to do but isn't impossible. However if you want to have a go yourself then:

      anywhere you see something like

      ar[i+1].sName

      then

      ar[i+1].sImage will contain the associated Section Image filename

      so (as a quick test) replacing all

      ar[i+1].sName

      with

      '<img src="' + ar[i+1].sImage + '>' + ar[i+1].sName

      may well work (for the top-level only)

      Best test using Firefox and turn on its Tools / JavaScript Console.

      PS The size of the sction images is also found in ar[i+1].nImageWidth and ar[i+1].nImageHeight
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Norman,

        Thanks for your reply - you beat me to it. for your info, what I have added is this (just after the "if (ar[i+1].pChild)" line in the main function).

        //Show section logo to left of text (if logo exists)
        if (ar[i+1].sImage != ""){
        topwithchildclosed = '<img src="' + ar[i+1].sImage +'" border="">';
        topwithchildopen = '<img src="' + ar[i+1].sImage +'" border="">';
        }
        else
        {
        topwithchildclosed = '';
        topwithchildopen = '';
        }

        I am not sure if it works too well, the text doesnt centre with the logo, so presumably I would have to add tables etc and that does seem like a lot of work!!

        incidently, where do you find the list of variables that are passed by yahoo sections? I couldnt find them anywhere and just took a gamble on the sImage variable name.

        Thanks for all your help (nearly there!),

        Paul.

        Comment


          #5
          where do you find the list of variables that are passed by yahoo sections
          Look in the generated Act_section_tree.js in Site1. That's what's created and loaded by NETQUOTEVAR:SECTIONTREERAW.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment

          Working...
          X