Page 1 of 1

Javscript function for panos within GroupID

PostPosted: Wed Mar 01, 2017 3:19 pm
by mikepostons
Hi guys,

need a bit of help. I'm building a custom template and looking for a way to hide/show a div based on group. I used the Debug Plugin to get the group IDs, but now looking at a way of targeting the JavaScript based on which group the panorama is in.

The current code I have is:

Code: Select all
function updatePanorama(panoid) {
{% if project.panoGroups.count %}
      {% for group in project.panoGroups %}
         {% if group.isExplicit %}
            {% for pano in group.panos %}

                                        /* action for non group pano */
                $('#exampleDiv').show();

            {% endfor %}

            {% else %}
               {% for pano in group.panos %}

               /* action for non group pano */
                                        $('#exampleDiv').hide();

            {% endfor %}
         {% endif %}
      {% endfor %}
   {% endif %}
}


But obviously this is currently targeting panos in all groups. Looking for something something along the lines of:

if pano has groupID of 'panogroup1411' then show div with ID of #exampleDiv

This would be a useful snippet of code to have for many people. Hoping someone with experience of the syntax can offer some advice. Thanks in advance.